:root {
      --primary: #02224B; --primary-light: #0B3068; --primary-dark: #01152F;
      --primary-ink: #02224B;
      --primary-bg: #EEF1FF; --accent: #627BFC; --accent-dark: #4F63D6; --accent-light: rgba(98,123,252,0.08);
      /* ── BLUE — primary action / interactive ── */
      /* --blue is the ACTION colour: solid fills that carry white text. It is now the
         brand navy, which gives white 15.75:1 -- readable on a phone in sunlight and
         defensible if a corporate buyer ever audits us.
         The brand periwinkle #627BFC cannot do this job: white on it is 3.65:1,
         below the 4.5:1 the standard asks for. So periwinkle keeps the job it is
         actually good at -- borders, focus rings, decoration, and fills on navy --
         via --accent; and --accent-dark (#4F63D6, 5.14:1) carries periwinkle-family
         TEXT on white. Same hierarchy as the brand sheet: navy is the field,
         periwinkle the highlight. */
      --blue: #02224B; --blue-600: #01152F; --blue-50: #EEF1FF; --blue-100: #DDE3FF;
      /* ink that sits ON a --blue fill; flipped in dark mode along with --blue */
      --btn-ink: #FFFFFF;
      /* on-navy variant — used for text/icons/borders sitting on the navy sidebar/hero surfaces,
         where --blue is too dark to meet contrast (see dark-mode block below) */
      --blue-onnavy: #7D92FD;
      --danger: #EF4444; --danger-bg: #FEE2E2; --success: #10B981; --success-bg: #D1FAE5;
      --warning: #F59E0B; --warning-bg: #FEF3C7; --info: #3B82F6; --info-bg: #DBEAFE;
      --text-primary: #0C1730; --text-secondary: #5A6478; --text-muted: #8A93A6;
      --bg-main: #F6F7FB; --bg-card: #FFFFFF; --bg-sidebar: #02224B;
      --border: #E7EAF3; --radius: 14px; --radius-sm: 9px; --radius-lg: 16px;
      /* Zoho-parity list tables (20 Aug): a hairline between rows and a neutral hover,
         so a long list reads as rows of data rather than a drawn grid. */
      --border-hairline: #EFF2F7; --row-hover: #F7F9FC;
      --shadow: 0 1px 2px rgba(12,23,48,0.04),0 1px 3px rgba(12,23,48,0.03);
      --shadow-md: 0 4px 12px rgba(12,23,48,0.07),0 2px 4px rgba(12,23,48,0.04);
      --shadow-lg: 0 20px 48px rgba(12,23,48,0.14),0 8px 16px rgba(12,23,48,0.07);
      --sidebar-width: 248px; --font: 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
    }
    /* ── DARK MODE ── */
    body.dark-mode {
      --primary-bg: #1e2a5e; --text-primary: #F9FAFB; --text-secondary: #D1D5DB; --text-muted: #6B7280;
      --bg-main: #0F172A; --bg-card: #1E293B; --bg-sidebar: #0A1020;
      --border: #334155; --border-hairline: #2A3547; --row-hover: rgba(148,163,184,0.07);
      /* On a dark page a navy button disappears into the background, so dark mode flips
         the pair: periwinkle carries the action and the ink on it goes dark. That is
         5.01:1 for the text and 4.01:1 for the button against the card behind it — both
         better than the 2.73:1 separation the old bright blue managed here. The rule
         underneath is one line: the button is whichever brand colour contrasts with the
         surface it sits on.
         The translucent tint tokens switch to rgba so they read as tinted chips against
         dark cards instead of solid near-white blocks. */
      --blue: #627BFC; --blue-600: #7D92FD; --btn-ink: #0A1330;
      /* --primary is the brand navy and does not change with the theme -- correct, it is
         a brand colour. But 65 places set text with `color:var(--primary)` inline, and
         navy text on a #1E293B card is 1.08:1: the invoice-number links in every list
         were effectively invisible in dark mode long before this PR. --primary-ink is
         "the brand navy, used as TEXT", so it can lighten for a dark surface while the
         brand colour itself stays put. */
      --primary-ink: #7D92FD;
      --blue-50: rgba(125,146,253,0.14); --blue-100: rgba(125,146,253,0.22);
      --shadow: 0 1px 3px rgba(0,0,0,0.4),0 1px 2px rgba(0,0,0,0.3);
      --shadow-md: 0 4px 6px rgba(0,0,0,0.4),0 2px 4px rgba(0,0,0,0.3);
      --danger-bg: #3B0E0E; --success-bg: #052E1C; --warning-bg: #2D1F00; --info-bg: #0C1A3B;
    }
    body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
      background: #0F172A; color: var(--text-primary); border-color: var(--border);
    }
    body.dark-mode .topbar { background: var(--bg-card); border-color: var(--border); }
    body.dark-mode table thead tr { background: #1E293B; }
    body.dark-mode tr:hover td { background: rgba(107,120,240,0.06) !important; }
    body.dark-mode .modal-header { background: linear-gradient(135deg,var(--primary-dark) 0%,var(--primary-light) 60%,var(--primary) 100%); }
    body.dark-mode .modal-footer { background: var(--bg-card); }
    body.dark-mode .auth-card { background: var(--bg-card); }
    body.dark-mode input, body.dark-mode select, body.dark-mode textarea { background: #0F172A; color: var(--text-primary); border-color: var(--border); }
    #dark-toggle { background:none;border:1px solid var(--border);border-radius:var(--radius-sm);padding:6px 10px;cursor:pointer;font-size:16px;color:var(--text-secondary);transition:all 0.15s; }
    #dark-toggle:hover { background:var(--bg-main); }
    *{box-sizing:border-box;margin:0;padding:0;}
    body{font-family:var(--font);background:var(--bg-main);color:var(--text-primary);display:flex;min-height:100vh;font-size:14px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;letter-spacing:-0.01em;}

    /* ── AUTH SCREEN ── */
    #auth-screen,#reset-screen,#invite-screen,#org-setup-screen,#mfa-challenge-screen{position:fixed;inset:0;background:linear-gradient(135deg,#000A1A 0%,var(--primary-dark) 40%,var(--primary) 75%,var(--primary-light) 100%);display:flex;align-items:center;justify-content:center;z-index:9999;padding:20px;overflow:auto;}
    #auth-screen::before,#reset-screen::before,#invite-screen::before,#org-setup-screen::before,#mfa-challenge-screen::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 70% 30%,rgba(107,120,240,0.12) 0%,transparent 60%);pointer-events:none;}
    .auth-card{background:rgba(255,255,255,0.98);backdrop-filter:blur(20px);border-radius:20px;padding:44px 40px;width:100%;max-width:420px;box-shadow:0 32px 80px rgba(0,0,0,0.45),0 0 0 1px rgba(255,255,255,0.08);position:relative;}
    .auth-logo{text-align:center;margin-bottom:30px;}
    .auth-logo-mark{display:inline-flex;align-items:center;gap:12px;margin-bottom:8px;}
    .auth-logo svg{width:48px;height:48px;}
    .auth-logo-img{height:38px;width:auto;display:block;}
    .auth-logo-text{font-size:22px;font-weight:800;color:var(--primary);line-height:1;letter-spacing:-0.5px;}
    .auth-logo-text span{color:var(--blue);font-weight:700;font-size:10.5px;text-transform:uppercase;letter-spacing:0.14em;display:block;margin-top:3px;}
    .auth-subtitle{font-size:13px;color:var(--text-muted);}
    .auth-tabs{display:flex;border-bottom:2px solid var(--border);margin-bottom:26px;}
    .auth-tab{flex:1;text-align:center;padding:11px;cursor:pointer;font-weight:600;font-size:13.5px;color:var(--text-muted);border-bottom:2.5px solid transparent;margin-bottom:-2px;transition:all 0.15s;}
    .auth-tab.active{color:var(--accent-dark);border-bottom-color:var(--accent);}
    .auth-form{display:none;}
    .auth-form.active{display:block;}
    .auth-error{background:#FEE2E2;color:#991B1B;padding:10px 14px;border-radius:var(--radius-sm);font-size:13px;margin-bottom:14px;display:none;border-left:3px solid var(--danger);}
    .auth-error.show{display:block;}
    .demo-badge{background:var(--primary-bg);border:1.5px solid rgba(107,120,240,0.25);border-radius:12px;padding:9px 14px;font-size:12.5px;color:var(--primary);text-align:center;margin-top:16px;cursor:pointer;transition:all 0.15s;font-weight:600;}
    .demo-badge:hover{background:var(--blue);color:var(--btn-ink);border-color:var(--blue);}

    /* ── AUTH, Nov 2026: split screen for sign in, free trial and check email ──
       Form on white on the left, the product or plan on navy on the right. The other
       auth screens (set password, two-factor, invite, add your business) share the
       inputs and buttons below inside a single white card. */
    #auth-screen{background:#FFFFFF;flex-direction:column;align-items:stretch;justify-content:flex-start;padding:0;color:#0C1730;letter-spacing:-0.01em}
    #auth-screen::before{display:none}
    #auth-screen [hidden]{display:none!important}
    #reset-screen,#invite-screen,#org-setup-screen,#mfa-challenge-screen{background:#F6F7FB}
    #reset-screen::before,#invite-screen::before,#org-setup-screen::before,#mfa-challenge-screen::before{display:none}
    #reset-screen .auth-card,#invite-screen .auth-card,#org-setup-screen .auth-card,#mfa-challenge-screen .auth-card{background:#FFFFFF;backdrop-filter:none;border:1px solid #E3E7EF;box-shadow:0 1px 3px rgba(12,23,48,0.06),0 16px 40px rgba(12,23,48,0.08)}
    .au-card{display:flex;flex-direction:column;gap:22px;max-width:460px}
    .au-card-logo{height:30px!important;width:auto}
    .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
    .au-staging{display:flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:6px 16px;background:#F5B83D;color:#1F1300;font-size:13px;font-weight:600;text-align:center;flex-shrink:0}
    .au-split{flex:1 0 auto;display:flex}
    .au-col{flex:1 1 520px;min-width:0;box-sizing:border-box;padding:32px clamp(20px,5vw,72px) 24px;display:flex;flex-direction:column;gap:28px}
    .au-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 24px}
    .au-head .auth-logo-img{height:33px;width:auto}
    .au-switch{font-size:14px;color:#5A6478}
    .au-switch a,.au-link{color:#4F63D6;font-weight:600;text-decoration:none}
    .au-switch a:hover,.au-link:hover{color:#3B4DB8;text-decoration:underline}
    .au-link-sm{font-size:14px;font-weight:500}
    .au-body{flex-grow:1;display:flex;align-items:center;justify-content:center}
    .au-main{width:100%;max-width:420px;display:flex;flex-direction:column;gap:24px}
    .au-headline{display:flex;flex-direction:column;gap:8px}
    .au-title{margin:0;font-size:34px;line-height:1.15;font-weight:700;letter-spacing:-0.03em;color:#0C1730}
    .au-lede{margin:0;font-size:16px;line-height:1.5;color:#5A6478}
    .au-lede strong{color:#0C1730;font-weight:600}
    .au-form{display:flex;flex-direction:column;gap:16px;margin:0}
    .au-field{display:flex;flex-direction:column;gap:7px}
    .au-field label{display:block;margin:0;font-size:14px;font-weight:600;color:#0C1730;text-transform:none;letter-spacing:normal}
    input.au-input,select.au-input{height:50px;box-sizing:border-box;border:1px solid #B7BFCE;border-radius:10px;padding:0 14px;font-size:16px;color:#0C1730;background:#FFFFFF;width:100%}
    input.au-input:focus,select.au-input:focus{border-color:#627BFC;box-shadow:0 0 0 3px rgba(98,123,252,0.2)}
    input.au-input::placeholder{color:#667085}
    .au-pw{position:relative;display:flex}
    .au-pw input.au-input{padding-right:54px}
    .au-eye{position:absolute;right:3px;top:3px;width:44px;height:44px;border:0;background:transparent;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#5A6478;cursor:pointer}
    .au-eye:hover{color:#0C1730}
    .au-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
    label.au-check{display:flex;align-items:flex-start;gap:10px;margin:0;font-size:14px;font-weight:400;line-height:1.5;color:#3A4358;text-transform:none;letter-spacing:normal;cursor:pointer}
    .au-check input[type="checkbox"]{width:18px;height:18px;margin:2px 0 0;padding:0;flex-shrink:0;accent-color:#02224B}
    .au-btn{height:52px;width:100%;border:0;border-radius:10px;background:#02224B;color:#FFFFFF;font-family:var(--font);font-size:16px;font-weight:600;cursor:pointer;transition:background 0.15s}
    .au-btn:hover{background:#0B3068}
    .au-btn:disabled,.au-btn-ghost:disabled{opacity:0.6;cursor:default}
    .au-btn-ghost{height:50px;width:100%;padding:0 20px;border:1px solid #B7BFCE;border-radius:10px;background:#FFFFFF;color:#0C1730;font-family:var(--font);font-size:15px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:10px}
    .au-btn-ghost:hover{border-color:#02224B}
    a.au-btn-ghost{box-sizing:border-box;text-decoration:none}
    select.au-input{padding:0 12px;appearance:auto}
    .au-lede-sm{font-size:15px}
    .au-title-md{font-size:30px}
    .au-kicker{font-size:13px;font-weight:600;color:#5A6478}
    .au-optional{font-weight:400;color:#5A6478}
    .au-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
    .au-grid2 > .au-field{min-width:0}
    .au-phone{display:flex;align-items:stretch;height:50px;border:1px solid #B7BFCE;border-radius:10px;overflow:hidden;background:#FFFFFF}
    .au-phone:focus-within{border-color:#627BFC;box-shadow:0 0 0 3px rgba(98,123,252,0.2)}
    .au-phone-cc{display:flex;align-items:center;padding:0 12px;background:#F6F7FB;border-right:1px solid #B7BFCE;font-size:15px;color:#3A4358}
    .au-phone input.au-input{height:100%;border:0;border-radius:0;box-shadow:none;min-width:0;flex:1 1 auto}
    .au-notice{margin:0;padding:14px 16px;border-radius:10px;background:#F6F7FB;font-size:14px;line-height:1.55;color:#3A4358}
    .au-signedin{padding:12px 14px;border-radius:12px;background:#F6F7FB;border:1px solid #E3E7EF;font-size:14px;color:#3A4358;overflow-wrap:anywhere}
    .au-signedin strong{color:#0C1730}
    .au-providers{display:flex;flex-direction:column;gap:12px}
    .au-or{display:flex;align-items:center;gap:14px;color:#5A6478;font-size:13px}
    .au-or::before,.au-or::after{content:'';flex-grow:1;height:1px;background:#E3E7EF}
    .au-sso-mark{width:20px;height:20px;border-radius:4px;background:#D9DEE8;flex-shrink:0}
    .au-btn-ghost svg{flex-shrink:0}
    a.au-btn-ghost:hover{text-decoration:none}
    .au-newhere{display:flex;flex-direction:column;gap:12px;padding-top:24px;border-top:1px solid #E3E7EF}
    .au-newhere-label{margin:0;font-size:14px;color:#5A6478;text-align:center}
    .au-note{margin:0;font-size:13px;color:#5A6478}
    .au-info{background:#ECFDF5;color:#065F46;border:1px solid #A7F3D0;padding:10px 14px;border-radius:10px;font-size:14px;line-height:1.5}
    .au-main .auth-error,.au-card .auth-error{border-radius:10px;font-size:14px;margin-bottom:0}
    .au-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 20px;font-size:13px;color:#5A6478}
    .au-foot nav{display:flex;gap:20px}
    .au-foot a{color:#5A6478;text-decoration:none}
    .au-foot a:hover{text-decoration:underline}
    .au-steps{list-style:none;margin:0;padding:0;display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:13px;color:#5A6478}
    .au-steps li{display:flex;align-items:center;gap:8px}
    .au-steps .au-dot{width:24px;height:24px;box-sizing:border-box;border-radius:50%;border:1px solid #B7BFCE;display:flex;align-items:center;justify-content:center;font-size:12px}
    .au-steps .is-current{color:#0C1730;font-weight:600}
    .au-steps .is-current .au-dot{background:#02224B;border-color:#02224B;color:#FFFFFF}
    .au-steps .is-done .au-dot{background:#D1FAE5;border-color:#D1FAE5;color:#065F46}
    .au-steps .au-sep{width:24px;height:1px;background:#B7BFCE}
    .au-meter{display:flex;align-items:center;gap:12px}
    .au-meter-bars{flex-grow:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
    .au-meter-bars span{height:4px;border-radius:2px;background:#E3E7EF;transition:background 0.15s}
    .au-meter-hint{font-size:13px;color:#5A6478;white-space:nowrap}
    .au-mailicon{width:64px;height:64px;border-radius:18px;background:#EEF1FF;color:#4F63D6;display:flex;align-items:center;justify-content:center}
    .au-help{border:1px solid #E3E7EF;background:#F6F7FB;border-radius:12px;padding:16px 18px;font-size:14px;line-height:1.5;color:#3A4358}
    .au-help strong{color:#0C1730}
    .au-actions{display:flex;flex-wrap:wrap;gap:12px}
    .au-actions .au-btn,.au-actions .au-btn-ghost{width:auto;padding:0 22px}

    /* The navy side */
    .au-aside{flex:1.15 1 560px;min-width:0;box-sizing:border-box;position:relative;overflow:hidden;background:#02224B;color:#FFFFFF;padding:56px clamp(24px,5vw,80px);display:flex;flex-direction:column;justify-content:center;gap:28px}
    .au-aside::before,.au-aside::after{content:'';position:absolute;border-radius:50%;border:1px solid rgba(125,146,253,0.2);pointer-events:none}
    .au-aside::before{width:760px;height:760px;right:-300px;top:-320px}
    .au-aside::after{width:520px;height:520px;right:-180px;top:-200px}
    .au-aside > *{position:relative;width:100%;max-width:500px}
    .au-aside-copy{display:flex;flex-direction:column;gap:14px}
    .au-eyebrow{font-size:12px;font-weight:600;letter-spacing:0.14em;text-transform:uppercase;color:#A9B8FE}
    .au-aside h2{margin:0;font-size:40px;line-height:1.12;font-weight:600;letter-spacing:-0.03em;color:#FFFFFF}
    .au-aside p{margin:0;font-size:17px;line-height:1.5;color:#C9D2EA}
    .au-muted{color:#C9D2EA}
    .au-aside-visual{display:flex;flex-direction:column;gap:14px}
    .au-inv-wrap{position:relative}
    .au-inv-wrap::before{content:'';position:absolute;top:14px;left:14px;right:-14px;bottom:-14px;border-radius:16px;background:rgba(255,255,255,0.1)}
    .au-inv{position:relative;background:#FFFFFF;color:#0C1730;border-radius:16px;padding:24px;box-shadow:0 30px 60px rgba(1,10,30,0.45);display:flex;flex-direction:column;gap:16px;font-size:13px}
    .au-inv-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
    .au-inv-label{font-size:11px;font-weight:600;letter-spacing:0.1em;color:#5A6478}
    .au-inv-no{font-size:18px;font-weight:700;letter-spacing:-0.02em}
    .au-paid{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:13px;background:#D1FAE5;color:#065F46;font-size:12px;font-weight:600}
    .au-inv-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
    .au-inv-meta span{display:block}
    .au-inv .k{color:#5A6478}
    .au-inv-meta .v{font-weight:600}
    .au-inv-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 16px;font-variant-numeric:tabular-nums}
    .au-rule{height:1px;background:#E3E7EF}
    .au-total{font-size:15px;font-weight:700}
    .au-total-v{font-size:18px;font-weight:700;letter-spacing:-0.02em}
    .au-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
    .au-kpi{border:1px solid rgba(255,255,255,0.16);background:rgba(255,255,255,0.06);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:4px}
    .au-kpi .k{font-size:12px;color:#C9D2EA}
    .au-kpi .v{font-size:19px;font-weight:700;letter-spacing:-0.02em;font-variant-numeric:tabular-nums}
    .au-kpi .s,.au-sample{font-size:12px;color:#A9B8FE}
    .au-picker{display:flex;flex-direction:column;gap:12px}
    .au-seg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;border-radius:12px;background:rgba(255,255,255,0.09)}
    .au-seg button{height:44px;border:0;border-radius:9px;font-family:var(--font);font-size:15px;font-weight:600;cursor:pointer;background:transparent;color:#E6EBF8}
    .au-seg button[aria-pressed="true"]{background:#FFFFFF;color:#02224B}
    .au-cycle{display:flex;align-items:center;flex-wrap:wrap;gap:4px;align-self:flex-start;width:auto!important;padding:3px;border-radius:10px;border:1px solid rgba(255,255,255,0.2)}
    .au-cycle button{height:36px;padding:0 14px;border:0;border-radius:7px;font-family:var(--font);font-size:14px;font-weight:600;cursor:pointer;background:transparent;color:#C9D2EA}
    .au-cycle button[aria-pressed="true"]{background:rgba(255,255,255,0.16);color:#FFFFFF}
    .au-save{padding:0 10px 0 6px;font-size:13px;font-weight:600;color:#A7F3D0}
    .au-plan{border:1px solid rgba(255,255,255,0.16);background:rgba(255,255,255,0.06);border-radius:18px;padding:26px 28px;display:flex;flex-direction:column;gap:18px;box-sizing:border-box}
    .au-plan-compact{gap:4px;padding:20px 22px}
    .au-plan-line{font-size:18px}
    .au-plan-name{font-size:15px;font-weight:600;color:#A9B8FE}
    .au-price{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;margin:6px 0}
    .au-price strong{font-size:48px;line-height:1;font-weight:700;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
    .au-price span{font-size:16px;color:#C9D2EA}
    .au-billed{font-size:14px;color:#C9D2EA}
    .au-feats{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;font-size:15px;color:#E6EBF8}
    .au-feats li{display:flex;align-items:flex-start;gap:10px}
    .au-feats svg{flex-shrink:0;margin-top:2px;color:#7D92FD}
    .au-trial{display:flex;align-items:flex-start;gap:12px;padding:16px 18px;border-radius:14px;box-sizing:border-box;background:rgba(167,243,208,0.1);border:1px solid rgba(167,243,208,0.28);font-size:14px;line-height:1.55;color:#E6EBF8}
    .au-trial svg{flex-shrink:0;margin-top:1px}
    .au-trial strong{color:#FFFFFF;font-weight:600}
    .au-nextsteps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:16px}
    .au-nextsteps li{display:flex;align-items:flex-start;gap:14px;font-size:16px;line-height:1.5}
    .au-nextsteps .au-dot{flex-shrink:0;width:26px;height:26px;box-sizing:border-box;border-radius:50%;border:1px solid rgba(255,255,255,0.5);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}
    .au-nextsteps .is-done .au-dot{background:#D1FAE5;border-color:#D1FAE5;color:#065F46}
    .au-nextsteps .is-current .au-dot{background:#FFFFFF;border-color:#FFFFFF;color:#02224B}
    .au-mplan{display:none}
    /* Sign in: the free-trial card on the navy side (Nov 2026 v4) */
    .au-aside h2.au-h2-sm{font-size:34px;line-height:1.15}
    .au-trialcard{box-sizing:border-box;border:1px solid rgba(255,255,255,0.18);background:rgba(255,255,255,0.07);border-radius:20px;padding:30px 32px;display:flex;flex-direction:column;gap:22px}
    .au-trialcard-head{display:flex;flex-direction:column;gap:8px}
    .au-trialcard h3{margin:0;font-size:28px;line-height:1.2;font-weight:700;letter-spacing:-0.02em;color:#FFFFFF}
    .au-trialcard p{font-size:16px}
    .au-eyebrow-green{color:#A7F3D0}
    .au-feats-lg{gap:12px;line-height:1.5}
    .au-feats-lg svg{margin-top:3px}
    .au-trialcard-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px 20px}
    .au-btn-white{height:52px;padding:0 26px;border-radius:10px;background:#FFFFFF;color:#02224B;font-size:16px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
    .au-btn-white:hover{background:#EEF1FF;color:#02224B;text-decoration:none}
    .au-link-white{color:#FFFFFF;font-size:15px;font-weight:600;text-decoration:underline;min-height:44px;display:inline-flex;align-items:center}
    .au-link-white:hover{color:#FFFFFF}
    /* Password and check-email: their first invoice, with the business they just entered */
    .au-inv-seller{display:flex;align-items:center;gap:12px;min-width:0}
    .au-inv-seller strong{display:block;font-size:16px;font-weight:700;letter-spacing:-0.02em;overflow-wrap:anywhere}
    .au-inv-seller .k{display:block}
    .au-inv-avatar{flex-shrink:0;width:40px;height:40px;border-radius:10px;background:#02224B;color:#FFFFFF;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:700}
    .au-draft{flex-shrink:0;display:inline-flex;align-items:center;height:26px;padding:0 10px;border-radius:13px;background:#EEF1FF;color:#3B4DB8;font-size:12px;font-weight:600}
    .au-inv-meta3{grid-template-columns:repeat(3,minmax(0,1fr))}
    .au-inv-nrs{display:flex;align-items:center;gap:14px;padding:12px;border-radius:10px;background:#F6F7FB;line-height:1.45;color:#3A4358}
    .au-qr{flex-shrink:0;width:48px;height:48px;box-sizing:border-box;border-radius:6px;border:1.5px dashed #B7BFCE}
    .au-inv-plan{margin-top:10px}
    #auth-screen :focus-visible,.au-card :focus-visible{outline:2px solid #627BFC;outline-offset:2px}
    #auth-demo-slot .demo-badge{margin-top:0}

    /* Phones and narrow windows: one column. Sign up keeps a compact plan panel above the form. */
    @media (max-width:1000px){
      .au-split{flex-direction:column}
      .au-aside-signin,.au-aside-check,.au-aside-password{display:none!important}
      .au-aside{flex:0 0 auto;padding:20px;gap:14px}
      .au-aside::before,.au-aside::after{display:none}
      .au-aside-signup{display:none!important}
      .au-mplan{display:flex;flex-direction:column;gap:14px;padding:16px;border-radius:14px;background:#02224B;color:#FFFFFF}
      .au-mplan-price{margin-top:6px;font-size:17px;color:#FFFFFF;font-variant-numeric:tabular-nums}
      .au-mplan-billed{font-size:13px;color:#C9D2EA}
      .au-mplan-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
      .au-seg-sm button{height:40px;font-size:14px}
      .au-steps{gap:6px;font-size:12px}
      .au-steps .au-sep{width:12px}
      .au-steps .au-dot{width:22px;height:22px;font-size:11px}
      .au-col{padding:20px;gap:22px}
      .au-title{font-size:28px}
    }

    /* Safety net: no canvas (chart) should ever be able to force the page
       wider than its container, regardless of its width/height attributes */
    canvas { max-width: 100%; }

    /* Flexbox/Grid items default to min-width:auto, which means they refuse
       to shrink below their content's natural size (e.g. a chart canvas) —
       this is what was causing horizontal scrolling on narrow screens. */
    .main, .page, .panel-grid, .kpi-grid,
    .panel-grid > *, .kpi-grid > *, .card, .kpi-card { min-width: 0; }

    /* ── PASSWORD VISIBILITY TOGGLE ── */
    .password-field-wrap{position:relative;}
    .password-field-wrap input{padding-right:40px;}
    .password-toggle-btn{position:absolute;right:2px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;font-size:15px;padding:7px 9px;line-height:1;color:var(--text-muted);border-radius:var(--radius-sm);transition:color 0.15s;}
    .password-toggle-btn:hover{color:var(--text-secondary);}

    /* ── SIDEBAR ── */
    .sidebar{width:var(--sidebar-width);background:var(--bg-sidebar);color:white;display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:100;overflow-y:auto;overflow-x:hidden;}
    .sidebar::after{content:'';position:absolute;top:0;right:0;bottom:0;width:1px;background:linear-gradient(to bottom,rgba(125,146,253,0.2) 0%,rgba(125,146,253,0.04) 60%,transparent 100%);}
    .sidebar-logo{padding:24px 20px 18px;border-bottom:1px solid rgba(255,255,255,0.07);}
    .logo-mark{display:flex;align-items:center;gap:11px;}
    .logo-icon{width:40px;height:40px;flex-shrink:0;}
    .logo-img{height:33px;width:auto;display:block;}
    .logo-text{font-size:19px;font-weight:800;color:white;line-height:1;letter-spacing:-0.5px;}
    .logo-text span{color:var(--blue-onnavy);font-weight:600;font-size:10px;text-transform:uppercase;letter-spacing:0.14em;display:block;margin-top:3px;}
    .sidebar-nav{padding:12px 0;flex:1;}
    .nav-section-label{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.12em;color:rgba(255,255,255,0.28);padding:14px 20px 5px;margin-top:4px;}
    .nav-item{display:flex;align-items:center;gap:10px;padding:9px 20px 9px 17px;color:rgba(255,255,255,0.58);cursor:pointer;transition:all 0.12s ease;border-left:3px solid transparent;font-size:13.5px;font-weight:500;user-select:none;margin:1px 8px 1px 0;border-radius:0 var(--radius-sm) var(--radius-sm) 0;}
    .nav-item:hover{background:rgba(255,255,255,0.06);color:rgba(255,255,255,0.88);}
    .nav-item.active{background:linear-gradient(90deg,rgba(55,87,251,0.28) 0%,rgba(55,87,251,0.05) 100%);color:white;border-left-color:var(--blue-onnavy);font-weight:600;}
    .nav-item.active .nav-icon{color:var(--blue-onnavy);}

    /* ── COLLAPSED SIDEBAR (22 Aug) ──────────────────────────────────────
       Reclaims ~180px for the table rather than making anything sticky. Labels are
       bare text nodes in the markup, so font-size:0 collapses them while the icons
       (SVGs with explicit width/height) are untouched. Groups can't expand in this
       state — clicking one re-opens the sidebar instead, which is predictable. */
    body.nav-collapsed{--sidebar-width:68px;}
    body.nav-collapsed .nav-item{font-size:0;gap:0;justify-content:center;padding-left:14px;padding-right:14px;margin-right:0;border-radius:0;}
    body.nav-collapsed .nav-icon{font-size:16px;}
    body.nav-collapsed .nav-caret,
    body.nav-collapsed .nav-group-label,
    body.nav-collapsed .nav-children,
    body.nav-collapsed .nav-pinned-strip,
    body.nav-collapsed .sidebar-footer .user-info > div:last-child,
    body.nav-collapsed .nrs-ready-tag,
    body.nav-collapsed .cloud-status{display:none;}
    body.nav-collapsed .logo-img{width:34px;object-fit:cover;object-position:left center;}
    .col-toolbar{justify-content:flex-end !important;}
    .col-choose-btn{white-space:nowrap;}
    body.nav-collapsed .sidebar-logo{padding:24px 16px 18px;}
    body.nav-collapsed .sidebar-footer{padding:12px 10px;}
    body.nav-collapsed .btn-logout{font-size:0;padding:9px 0;}
    body.nav-collapsed .btn-logout::after{content:'⎋';font-size:15px;}
    .nav-collapse-btn{display:flex;align-items:center;gap:9px;width:100%;background:none;border:none;color:rgba(255,255,255,0.5);cursor:pointer;font-family:var(--font);font-size:12px;font-weight:600;padding:9px 20px;transition:color 0.12s;}
    .nav-collapse-btn:hover{color:rgba(255,255,255,0.9);}
    .nav-collapse-btn svg{flex-shrink:0;transition:transform 0.18s ease;}
    body.nav-collapsed .nav-collapse-btn{justify-content:center;padding:9px 0;font-size:0;}
    body.nav-collapsed .nav-collapse-btn svg{transform:rotate(180deg);}

    /* ── COLUMN CHOOSER: hide any column the user has switched off ── */
    .col-menu{display:none;position:fixed;z-index:300;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);min-width:200px;max-height:60vh;overflow-y:auto;padding:8px;}
    .col-menu.open{display:block;}
    .col-menu-head{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-muted);padding:4px 8px 8px;}
    .col-menu label{display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:6px;font-size:13px;font-weight:500;color:var(--text-primary);text-transform:none;letter-spacing:0;margin:0;cursor:pointer;}
    .col-menu label:hover{background:var(--bg-main);}
    .col-menu input{width:15px;height:15px;accent-color:var(--primary);margin:0;}

    /* ── GROUPED NAVIGATION ──────────────────────────────────────────
       Twenty-two flat rows became eleven doors. A flat list makes every item
       harder to find than the one before it, and the sidebar ran past the fold
       on a laptop and well past it on a phone.
       Nothing is hidden: every page that existed still has a row, and two that
       had no row at all -- Trial Balance and Year End -- gained one. */
    .nav-group-head{justify-content:flex-start;}
    .nav-group-label{flex:1;}
    /* opacity:0.5 sat on top of text that is already rgba(255,255,255,0.58), so the
       caret rendered at an effective 0.29 alpha on navy -- about 2.4:1, under the 3:1
       the standard asks of a non-text control, and not what was intended. Given its
       own colour at full opacity it measures over 9:1. */
    .nav-caret{transition:transform 0.18s ease;color:rgba(255,255,255,0.78);font-size:17px;line-height:1;font-weight:700;}
    .nav-item:hover .nav-caret,.nav-group.open>.nav-group-head .nav-caret{color:#fff;}
    .nav-group.open>.nav-group-head .nav-caret{transform:rotate(90deg);}
    .nav-group.open>.nav-group-head{color:rgba(255,255,255,0.92);}
    .nav-children{display:none;padding:2px 0 6px;}
    .nav-group.open>.nav-children{display:block;}
    /* Children are indented instead of icon-led: at this size a second column of
       icons reads as noise, and the indent already says "inside". */
    .nav-child{padding-left:44px;font-size:13px;}
    .nav-child .nav-icon{display:none;}
    .nav-group-head:focus-visible{outline:2px solid var(--blue-onnavy);outline-offset:-2px;}

    /* ── PINNING ─────────────────────────────────────────────────────
       Grouping the menu cost a click on the pages you open most: Invoices went
       from one click to two because it sits inside Sales. The strip gives that
       click back, and lets each person decide which pages earn it.

       No pins, no strip -- the element is `hidden` until something is pinned, so
       nothing appears until it is used. The star is invisible until you hover the
       row it belongs to, except on a phone, where there is no hover to wait for. */
    .nav-pinned-strip{padding-bottom:6px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,0.07);}
    .nav-pinned-label{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.12em;color:rgba(255,255,255,0.28);padding:2px 20px 5px;}
    .nav-pin-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    /* A mark, not a button. Pinning moved into the right-click menu because a star at
       the end of the row sat directly under the cursor's path to the row itself, and
       pinning something you were only trying to open leaves a destination you did not
       choose sitting at the top of your menu. pointer-events:none makes that
       impossible rather than unlikely. */
    .nav-pin{margin-left:auto;flex-shrink:0;font-size:11px;line-height:1;padding:0 2px;
      color:var(--blue-onnavy);opacity:0;pointer-events:none;transition:opacity 0.12s ease;}
    .nav-pin.pinned{opacity:0.9;}

    /* The three dots. They OPEN a menu -- they never pin -- which is what makes them
       safe to put back in the row the star was banished from. Hidden until you hover the
       row on a laptop; always there on a phone, where there is no hover to wait for. */
    .nav-dots{margin-left:6px;flex-shrink:0;background:none;border:0;cursor:pointer;
      color:rgba(255,255,255,0.62);font-size:16px;line-height:1;padding:3px 5px;border-radius:5px;
      opacity:0;transition:opacity 0.12s ease,background 0.12s ease,color 0.12s ease;}
    .nav-pin.pinned+.nav-dots{margin-left:6px;}
    .nav-pin:not(.pinned){margin-left:auto;}
    .nav-item:hover .nav-dots,.nav-dots:focus-visible{opacity:1;}
    .nav-dots:hover{background:rgba(255,255,255,0.16);color:#fff;}
    .nav-dots:focus-visible{outline:2px solid var(--blue-onnavy);outline-offset:-2px;}

    /* The menu itself. Fixed rather than absolute so it is placed at the pointer and
       stays there, and above the sidebar's own stacking context. */
    .nav-menu{position:fixed;z-index:400;min-width:220px;background:var(--bg-card);
      border:1px solid var(--border);border-radius:var(--radius-sm);
      box-shadow:0 12px 32px rgba(2,34,75,0.22);padding:5px;}
    .nav-menu-head{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;
      color:var(--text-muted);padding:7px 10px 6px;}
    .nav-menu button{display:flex;align-items:center;gap:9px;width:100%;text-align:left;
      background:none;border:0;cursor:pointer;font:inherit;font-size:13px;color:var(--text-primary);
      padding:9px 10px;border-radius:var(--radius-sm);}
    .nav-menu button:hover{background:var(--bg-main);}
    .nav-menu button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}
    .nav-menu-sep{height:1px;background:var(--border);margin:5px 6px;}
    /* No hover on a phone, so the dots are always there -- at a size a thumb can hit,
       and with the menu itself sized to match. */
    @media (max-width:767px){
      .nav-dots{opacity:1;min-width:40px;height:40px;font-size:19px;display:inline-flex;align-items:center;justify-content:center;}
      .nav-menu{min-width:250px;}
      .nav-menu button{padding:12px 12px;font-size:14px;}
    }

    /* Quick Actions picker */
    .qa-group{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--text-muted);padding:12px 0 4px;}
    .qa-group:first-child{padding-top:0;}
    /* label is styled globally as a form caption -- block, uppercase, bold. A picker
       row is a sentence with a checkbox, so it overrides all of that rather than
       inheriting a rule written for something else. */
    .qa-row{display:flex;align-items:center;gap:10px;padding:7px 6px;margin:0;font-size:13px;font-weight:500;color:var(--text-primary);cursor:pointer;border-radius:var(--radius-sm);text-transform:none;letter-spacing:normal;}
    .qa-row input[type=checkbox]{flex:0 0 auto;width:16px;height:16px;margin:0;accent-color:var(--accent);}
    .qa-row>span:first-of-type{flex:1;}
    .qa-pos{flex:0 0 auto;min-width:20px;height:20px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:transparent;}
    .qa-row.qa-chosen .qa-pos{background:var(--primary-bg);color:var(--accent-dark);}
    .qa-row.qa-over.qa-chosen .qa-pos{background:#FDECEA;color:#B3261E;}
    .qa-row:hover{background:var(--bg-main);}
    /* A phone has no hover, so the star is always there -- and at a size a thumb can
       actually hit, rather than the 21px box the desktop rule gives it. */
    .nav-icon{font-size:16px;width:20px;text-align:center;flex-shrink:0;transition:color 0.12s;}
    .sidebar-footer{padding:14px 20px 18px;border-top:1px solid rgba(255,255,255,0.07);}
    .user-info{display:flex;align-items:center;gap:10px;margin-bottom:10px;}
    .user-avatar{width:32px;height:32px;border-radius:10px;background:linear-gradient(135deg,var(--blue) 0%,var(--blue-600) 100%);color:var(--btn-ink);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0;box-shadow:0 2px 8px rgba(55,87,251,0.35);}
    .user-email{font-size:10.5px;color:rgba(255,255,255,0.45);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
    .biz-name-tag{font-weight:700;color:rgba(255,255,255,0.88);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
    .nrs-ready-tag{font-size:10.5px;color:rgba(255,255,255,0.32);margin-top:5px;display:flex;align-items:center;gap:4px;}
    .btn-logout{background:rgba(255,255,255,0.07);border:1px solid rgba(255,255,255,0.1);color:rgba(255,255,255,0.5);padding:6px 10px;border-radius:var(--radius-sm);font-size:11px;font-family:var(--font);cursor:pointer;width:100%;margin-top:8px;transition:all 0.15s;font-weight:500;}
    .btn-logout:hover{background:rgba(255,255,255,0.14);color:rgba(255,255,255,0.85);border-color:rgba(255,255,255,0.2);}
    .cloud-status{font-size:10px;color:rgba(255,255,255,0.3);text-align:center;margin-top:5px;min-height:14px;}

    /* ── MAIN ── */
    .main{margin-left:var(--sidebar-width);flex:1;display:flex;flex-direction:column;min-height:100vh;}
    .topbar{background:var(--bg-card);border-bottom:1px solid var(--border);padding:14px 28px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:50;box-shadow:0 1px 0 var(--border);}
    .topbar-title{font-size:17px;font-weight:700;color:var(--text-primary);letter-spacing:-0.3px;}
    .topbar-actions{display:flex;gap:8px;align-items:center;}
    .page{display:none;padding:28px 28px;}
    .page.active{display:block;}

    /* ── CARDS ── */
    .card{background:var(--bg-card);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);}
    .card-header{padding:18px 24px 15px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;}
    .card-title{font-size:14.5px;font-weight:650;color:var(--text-primary);letter-spacing:-0.2px;}
    .card-body{padding:24px;}

    /* ── KPI ── */
    .kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px;}
    .kpi-card{background:var(--bg-card);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);padding:22px 22px 20px;position:relative;overflow:hidden;transition:box-shadow 0.2s,transform 0.2s;}
    .kpi-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
    .kpi-icon-wrap{width:40px;height:40px;border-radius:10px;background:var(--kpi-bg,var(--accent-light));display:flex;align-items:center;justify-content:center;margin-bottom:14px;font-size:20px;}
    .kpi-icon{font-size:22px;margin-bottom:0;}
    .kpi-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.07em;color:var(--text-muted);margin-bottom:6px;}
    .kpi-value{font-size:clamp(16px,1.7vw,26px);font-weight:800;color:var(--text-primary);line-height:1.15;margin-bottom:5px;letter-spacing:-0.5px;overflow-wrap:break-word;word-break:break-word;font-variant-numeric:tabular-nums;}
    .kpi-sub{font-size:11.5px;color:var(--text-muted);}

    /* ── MONEY CARDS (dashboard rebuild, 23 Aug) ──
       A total on its own cannot tell you whether a balance is healthy. ₦4M owed is a good
       month if it is all current and a crisis if it is all overdue, so every money card
       carries a two-segment bar and names both halves underneath. The bar is the fast
       read; the legend is the exact figure. */
    .money-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;}
    .money-card{background:var(--bg-card);border-radius:var(--radius);border:1px solid var(--border);box-shadow:var(--shadow);padding:20px 22px 18px;transition:box-shadow 0.2s,transform 0.2s;}
    .money-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
    .money-card-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.07em;color:var(--text-muted);margin-bottom:8px;}
    .money-card-value{font-size:clamp(18px,1.8vw,27px);font-weight:800;color:var(--text-primary);line-height:1.15;letter-spacing:-0.5px;font-variant-numeric:tabular-nums;overflow-wrap:break-word;}
    .money-bar{display:flex;height:8px;border-radius:999px;overflow:hidden;background:var(--border);margin:14px 0 10px;}
    .money-bar-seg{display:block;height:100%;transition:width 0.3s ease;}
    .money-bar-current{background:var(--accent);}
    .money-bar-overdue{background:var(--danger);}
    .money-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:11.5px;color:var(--text-secondary);}
    .money-legend b{font-variant-numeric:tabular-nums;font-weight:700;color:var(--text-primary);}
    .money-dot{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:5px;vertical-align:0;}
    .money-dot-current{background:var(--accent);}
    .money-dot-overdue{background:var(--danger);}
    .money-collected{font-size:11.5px;color:var(--text-muted);margin-top:8px;padding-top:8px;border-top:1px solid var(--border);}
    .money-collected b{font-variant-numeric:tabular-nums;font-weight:700;color:var(--text-secondary);}

    /* Required actions. Severity is carried by a left border rather than a filled
       background: a stack of tinted rows reads as an error state even when the items are
       routine. */
    .dash-action{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;border:1px solid var(--border);border-left:4px solid var(--text-muted);border-radius:var(--radius-sm);margin-bottom:8px;}
    .dash-action.is-urgent{border-left-color:var(--danger);}
    .dash-action.is-soon{border-left-color:var(--warning,#d97706);}
    .dash-action-text{font-size:13px;color:var(--text-primary);line-height:1.45;min-width:0;}
    .dash-action-sub{font-size:11.5px;color:var(--text-muted);margin-top:2px;}

    /* Compact tax calendar. Same rows as the Tax page, stripped to date and countdown. */
    .dash-tax-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--border);}
    .dash-tax-row:last-child{border-bottom:none;}
    .dash-tax-name{font-size:13px;font-weight:700;color:var(--text-primary);}
    .dash-tax-when{font-size:11.5px;color:var(--text-muted);margin-top:1px;}

    /* Clearance-queue filter chips. */
    .nrs-qfilter{display:inline-flex;border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;}
    .nrs-qfilter button{border:none;background:transparent;font-family:var(--font);font-size:12px;font-weight:600;
      color:var(--text-secondary);padding:6px 12px;cursor:pointer;border-right:1px solid var(--border);}
    .nrs-qfilter button:last-child{border-right:none;}
    .nrs-qfilter button:hover{background:var(--bg-main);}
    .nrs-qfilter button.active{background:var(--accent);color:#fff;}

    /* ── BUTTONS ── */
    .btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:var(--radius-sm);font-size:13.5px;font-weight:600;cursor:pointer;border:none;transition:all 0.15s cubic-bezier(0.4,0,0.2,1);text-decoration:none;white-space:nowrap;font-family:var(--font);letter-spacing:-0.01em;}
    .btn-primary{background:var(--blue);color:var(--btn-ink);} .btn-primary:hover{background:var(--blue-600);transform:translateY(-1px);}
    .btn-accent{background:var(--accent);color:white;box-shadow:0 1px 4px rgba(98,123,252,0.25);} .btn-accent:hover{background:var(--accent-dark);box-shadow:0 2px 8px rgba(98,123,252,0.35);transform:translateY(-1px);}
    .btn-outline{background:transparent;color:var(--text-secondary);border:1.5px solid var(--border);}
    .btn-outline:hover{border-color:#CBD3E6;}
    .btn-danger{background:var(--danger);color:white;box-shadow:0 1px 4px rgba(239,68,68,0.2);} .btn-danger:hover{background:#DC2626;transform:translateY(-1px);}
    .btn-success{background:var(--success);color:white;} .btn-success:hover{background:#059669;}
    .btn-nrs{background:var(--blue-50);color:var(--blue-600);border:1.5px solid var(--blue-100);}
    .btn-nrs:hover{background:var(--blue);color:var(--btn-ink);border-color:var(--blue);}
    .btn-sm{padding:5px 12px;font-size:12px;}
    .btn-lg{padding:11px 24px;font-size:14.5px;font-weight:700;}
    .btn:disabled{opacity:0.5;cursor:not-allowed;transform:none !important;box-shadow:none !important;}
    .btn-spinner{display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;opacity:0.85;animation:btnSpin 0.6s linear infinite;flex-shrink:0;}
    @keyframes btnSpin{to{transform:rotate(360deg);}}

    /* ── TABLES ── */
    .table-wrap{overflow-x:auto;}
    /* The sideways-scroll affordance is a phone-only thing. The shell and its two
       children are injected on every screen size by enhanceScrollableTables(), so
       they are hidden here and only given an appearance inside the ≤767px block
       below -- on a laptop nothing about a table changes. */
    .table-scroll-fade,.table-scroll-cue{display:none;}
    table{width:100%;border-collapse:collapse;}
    /* Zoho-parity (20 Aug): the old header was 11px UPPERCASE 700 with wide tracking —
       it competed with the data underneath. Sentence case at a normal weight recedes,
       which is what a column heading should do. Rows get real height and only a
       hairline between them; no vertical rules anywhere. */
    th{text-align:left;font-size:12px;font-weight:600;letter-spacing:0.01em;color:var(--text-secondary);padding:13px 20px;border-bottom:1px solid var(--border-hairline);background:var(--bg-main);}
    td{padding:16px 20px;border-bottom:1px solid var(--border-hairline);color:var(--text-primary);font-size:13.5px;font-variant-numeric:tabular-nums;}

    /* ── ROW ACTION MENU (kebab) — used where a row can have several actions
       that would otherwise overflow the table on narrower screens ── */
    .row-menu-btn{padding:5px 10px;font-size:16px;line-height:1;font-weight:700;letter-spacing:1px;}
    .row-menu{display:none;position:fixed;z-index:300;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);min-width:170px;padding:6px;flex-direction:column;gap:1px;overflow-y:auto;}
    .row-menu.open{display:flex;}
    .row-menu a{text-decoration:none;}
    .row-menu button,.row-menu a{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:none;padding:9px 10px;border-radius:6px;font-size:13px;font-weight:500;color:var(--text-primary);cursor:pointer;transition:background 0.12s;white-space:nowrap;}
    .row-menu button:hover,.row-menu a:hover{background:var(--bg-main);}
    .row-menu button.row-menu-danger{color:var(--danger);}
    .row-menu button.row-menu-danger:hover{background:rgba(239,68,68,0.08);}
    /* A disabled row-menu item was rendering identically to an enabled one -- full colour,
       pointer cursor -- so an option blocked pending NRS clearance looked perfectly
       clickable and simply did nothing. A block nobody can see reads as a broken app. */
    .row-menu button:disabled{color:var(--text-muted);opacity:0.45;cursor:not-allowed;}
    .row-menu button:disabled:hover{background:none;}
    .row-menu button.row-menu-danger:disabled{color:var(--text-muted);}
    tr:last-child td{border-bottom:none;}
    tbody tr{transition:background 0.1s;}
    tbody tr:hover td{background:var(--row-hover);}


    /* Column widths, third correction (22 Aug). No column gets more room than its
       content needs: a blanket 210px floor on the first column was right for an item
       name and absurd for "INV001". Columns now size to content; only genuinely long
       text is capped, and only the identity column may wrap (Zoho wraps a long name
       over two or three lines rather than stretching the column). Nothing is sticky —
       pinning the actions read as clever and felt wrong to use. Where a table is
       still too wide, the collapsible nav and the column chooser are the answer.
       Scoped to LIST tables — the document line-item editors hold inputs. */
    .table-wrap > table:not(.line-items-table):not(.cn-line-items-table) tbody td:first-child{
      font-weight:600;white-space:normal;max-width:280px;
    }
    .table-wrap > table:not(.line-items-table):not(.cn-line-items-table) th:not(:first-child),
    .table-wrap > table:not(.line-items-table):not(.cn-line-items-table) td:not(:first-child){
      white-space:nowrap;max-width:260px;overflow:hidden;text-overflow:ellipsis;
    }

    /* A card wrapping a list table carries NO box at all. Two earlier attempts missed
       the point: dropping the shadow left the outline, and dropping the outline left
       the real culprit — the page's 28px padding, which framed the white card with a
       grey gutter on all four sides. Measured against Zoho's own DOM (22 Aug): every
       wrapper around their table is transparent with zero border and zero radius, and
       the content region is ONE continuous white surface the table bleeds across.
       So: no border/radius/shadow, no divider under the header (it read as a lid),
       the page surface goes white and fills the viewport, and the card cancels the
       page padding so header band and row hairlines run edge to edge. Cards holding
       anything else — KPIs, dashboard panels — are untouched. */
    .card:has(> .table-wrap > table), .card:has(> table){border:none;border-radius:0;box-shadow:none;}
    .card:has(> .table-wrap > table) > .card-header{border-bottom:none;padding:2px 20px 10px;}
    /* Opt-in, not automatic: a page whose whole job is ONE list gets the full-bleed
       surface. Pages that stack several panels (Reports, Tax, NRS, Year End) keep
       boxed cards — bleeding each of four report tables would merge them into one
       unreadable sheet. Marked with .list-surface in the markup so it stays obvious
       which pages opted in, rather than hiding the decision in a :has() chain. */
    .page.active:has(> .list-surface){background:var(--bg-card);flex:1;}
    .list-surface{margin-left:-28px;margin-right:-28px;margin-bottom:-28px;}
    .page-hero + .list-surface{margin-top:-22px;}

    table.col-hide-1 th:nth-child(1),table.col-hide-1 td:nth-child(1){display:none;}
    table.col-hide-2 th:nth-child(2),table.col-hide-2 td:nth-child(2){display:none;}
    table.col-hide-3 th:nth-child(3),table.col-hide-3 td:nth-child(3){display:none;}
    table.col-hide-4 th:nth-child(4),table.col-hide-4 td:nth-child(4){display:none;}
    table.col-hide-5 th:nth-child(5),table.col-hide-5 td:nth-child(5){display:none;}
    table.col-hide-6 th:nth-child(6),table.col-hide-6 td:nth-child(6){display:none;}
    table.col-hide-7 th:nth-child(7),table.col-hide-7 td:nth-child(7){display:none;}
    table.col-hide-8 th:nth-child(8),table.col-hide-8 td:nth-child(8){display:none;}
    table.col-hide-9 th:nth-child(9),table.col-hide-9 td:nth-child(9){display:none;}
    table.col-hide-10 th:nth-child(10),table.col-hide-10 td:nth-child(10){display:none;}
    table.col-hide-11 th:nth-child(11),table.col-hide-11 td:nth-child(11){display:none;}
    table.col-hide-12 th:nth-child(12),table.col-hide-12 td:nth-child(12){display:none;}
    table.col-hide-13 th:nth-child(13),table.col-hide-13 td:nth-child(13){display:none;}
    table.col-hide-14 th:nth-child(14),table.col-hide-14 td:nth-child(14){display:none;}
    table.col-hide-15 th:nth-child(15),table.col-hide-15 td:nth-child(15){display:none;}
    table.col-hide-16 th:nth-child(16),table.col-hide-16 td:nth-child(16){display:none;}

    /* Document detail action bar (22 Aug): one tidy row, wrapping only when it must,
       with the overflow menu anchored at the end. */
    .doc-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-start;width:100%;padding-top:4px;border-top:1px solid var(--border-hairline);margin-top:4px;}
    .doc-actions .row-menu-btn{letter-spacing:0;font-size:13px;font-weight:600;}

    /* ── DOCUMENT SHEET ─────────────────────────────────────────────────────
       "Can the invoice look like it will look on paper while looking at it on the
       screen" (22 Aug). The detail page already held the whole document; it just
       read as a stack of app cards. This makes it a page: A4-ish measure, centred,
       white, with the nested cards' chrome removed so the line items, totals and
       payment details flow as one sheet instead of three boxes. */
    .doc-sheet{
      background:var(--bg-card);max-width:880px;margin:18px auto 40px;padding:34px 38px 40px;
      border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:0 1px 3px rgba(15,23,42,0.06);
    }
    .doc-sheet > .card,
    .doc-sheet > .card:has(table){background:transparent;border:none;box-shadow:none;border-radius:0;margin-top:22px;}
    .doc-sheet > .card > .card-header{padding:0 0 10px;border-bottom:1px solid var(--border-hairline);}
    .doc-sheet .table-wrap{overflow-x:auto;}
    .doc-sheet > .card:first-child{margin-top:0;}
    /* the sheet is the page, so it shouldn't scroll sideways at laptop widths */
    .doc-sheet table th:first-child,.doc-sheet table td:first-child{max-width:none;}
    @media (max-width:767px){
      .doc-sheet{padding:18px 14px 24px;margin:12px 0 24px;border-radius:0;border-left:none;border-right:none;}
    }
    @media print{
      .doc-sheet{border:none;box-shadow:none;margin:0;padding:0;max-width:none;}
    }

    /* ── PRINTED-DOCUMENT VIEW (.pdoc) ──────────────────────────────────────
       "Make it look on screen the way it looks printed" (22 Aug). This mirrors the
       approved invoice concept the PDF draws — identity left, document type right in
       navy, mint NRS block, navy table header, navy total bar — using the SAME hex
       values as downloadInvoicePDF()'s constants so the two can't drift apart by eye:
         PRIMARY #1A2454 · BGLIGHT #F0F1F9 · BORDER #E5E7EB
         TEXTMAIN #111827 · TEXTGRAY #6B7280 · SUCCESSBG #ECFDF3 · NRSBORDER #ABEFC6
       One component serves invoices, quotes, purchase orders and receipts, so every
       document reads the same on screen and on paper. */
    .pdoc{--pd-danger:#EF4444;
      --pd-primary:#1A2454;--pd-bglight:#F0F1F9;--pd-border:#E5E7EB;--pd-main:#111827;
      --pd-gray:#6B7280;--pd-successbg:#ECFDF3;--pd-successborder:#ABEFC6;--pd-success:#10B981;
      background:#fff;color:var(--pd-main);max-width:820px;margin:0 auto;padding:38px 40px 30px;
      font-size:13px;line-height:1.5;}
    .pdoc-top{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;}
    .pdoc-ident{max-width:60%;}
    /* Fitted to the same proportion the PDF gives it (18mm on a 210mm page), not the
       42px it had -- a square logo was rendering as a thumbnail next to 17px type. */
    .pdoc-logo{max-height:62px;max-width:200px;object-fit:contain;object-position:left center;
      display:block;margin-bottom:10px;}
    .pdoc-mark{width:32px;height:32px;border-radius:7px;background:var(--pd-primary);color:#fff;
      display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;margin-bottom:10px;}
    .pdoc-biz{font-size:17px;font-weight:800;color:var(--pd-main);letter-spacing:-0.3px;}
    .pdoc-idline{font-size:11.5px;color:var(--pd-gray);margin-top:3px;}
    .pdoc-type{font-size:25px;font-weight:800;color:var(--pd-primary);letter-spacing:-0.5px;text-align:right;line-height:1;}
    .pdoc-num{font-size:14px;font-weight:700;color:var(--pd-main);text-align:right;margin-top:7px;}
    .pdoc-metaline{font-size:11.5px;color:var(--pd-gray);text-align:right;margin-top:3px;}
    .pdoc-stamp{display:inline-block;margin-top:7px;font-size:12px;font-weight:800;letter-spacing:1px;color:var(--pd-success);}
    .pdoc-rule{height:1px;background:var(--pd-border);margin:20px 0 16px;}
    .pdoc-parties{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;}
    .pdoc-label{font-size:9.5px;font-weight:700;letter-spacing:0.09em;text-transform:uppercase;color:var(--pd-gray);margin-bottom:5px;}
    .pdoc-party-name{font-size:14px;font-weight:700;color:var(--pd-main);}
    .pdoc-amountdue{text-align:right;}
    .pdoc-amountdue .v{font-size:20px;font-weight:800;color:var(--pd-primary);margin-top:3px;}
    .pdoc-nrs{background:var(--pd-successbg);border:1px solid var(--pd-successborder);border-radius:8px;
      padding:14px 16px;margin:18px 0;display:flex;gap:16px;align-items:center;justify-content:space-between;}
    .pdoc-nrs-badge{display:inline-block;background:var(--pd-success);color:#fff;font-size:10px;font-weight:800;
      letter-spacing:0.06em;padding:5px 11px;border-radius:20px;}
    .pdoc-irn{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;font-weight:700;color:var(--pd-main);margin-top:9px;}
    .pdoc-nrs-note{font-size:11px;color:var(--pd-gray);margin-top:4px;}
    .pdoc-qr{width:88px;height:88px;flex-shrink:0;}
    .pdoc table{width:100%;border-collapse:collapse;margin-top:18px;}
    .pdoc thead th{background:var(--pd-primary);color:#fff;font-size:10px;font-weight:700;letter-spacing:0.05em;
      text-transform:uppercase;padding:9px 10px;text-align:left;border:none;white-space:nowrap;}
    .pdoc tbody td{padding:10px;border-bottom:1px solid var(--pd-border);font-size:12.5px;color:var(--pd-main);
      vertical-align:top;background:transparent;max-width:none;white-space:normal;}
    .pdoc tbody tr:hover td{background:transparent;}
    .pdoc .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;}
    .pdoc-itemname{font-weight:700;}
    .pdoc-itemdesc{font-size:11.5px;color:var(--pd-gray);margin-top:2px;}
    .pdoc-totals{margin-top:16px;margin-left:auto;width:min(300px,100%);}
    .pdoc-totals .row{display:flex;justify-content:space-between;padding:5px 0;font-size:12.5px;color:var(--pd-gray);}
    .pdoc-totals .row span:last-child{color:var(--pd-main);font-variant-numeric:tabular-nums;}
    .pdoc-totals .row.danger span{color:var(--pd-danger);}
    .pdoc-totals .row.rule{border-top:1px solid var(--pd-border);margin-top:4px;padding-top:8px;}
    .pdoc-totalbar{display:flex;justify-content:space-between;align-items:center;background:var(--pd-primary);
      color:#fff;border-radius:6px;padding:11px 14px;margin-top:8px;font-weight:800;font-size:14px;}
    /* The totals column is right-hand on paper; the total bar sits under it, not
       across the page — mirrors the PDF's roundedRect at totX. */
    .pdoc-totalstack{margin-left:auto;width:min(320px,100%);}
    .pdoc-totalstack .pdoc-totals{margin-top:0;width:100%;}
    .pdoc-totalnote{font-size:10.5px;color:var(--pd-gray);margin-top:8px;line-height:1.5;}
    .pdoc-panel{background:var(--pd-bglight);border-radius:8px;padding:14px 16px;margin-top:22px;font-size:12px;color:var(--pd-main);}
    .pdoc-panel .pdoc-label{margin-bottom:6px;}
    /* HOW TO PAY — the PDF's navy band over a bordered body (concept block). */
    .pdoc-pay{margin-top:22px;border:1px solid var(--pd-border);border-radius:7px;overflow:hidden;}
    .pdoc-pay-head{background:var(--pd-primary);color:#fff;font-size:10px;font-weight:800;
      letter-spacing:0.09em;padding:8px 14px;}
    .pdoc-pay-body{padding:14px 16px;}
    .pdoc-pay-title{font-size:12.5px;font-weight:700;color:var(--pd-main);margin-bottom:10px;}
    .pdoc-pay-acct + .pdoc-pay-acct{margin-top:14px;padding-top:14px;border-top:1px solid var(--pd-border);}
    .pdoc-pay-cap{font-size:9.5px;font-weight:700;letter-spacing:0.08em;text-transform:uppercase;
      color:var(--pd-gray);margin-bottom:7px;}
    .pdoc-pay-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px 18px;}
    .pdoc-pay-k{font-size:9.5px;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--pd-gray);}
    .pdoc-pay-v{font-size:13px;font-weight:700;color:var(--pd-main);font-variant-numeric:tabular-nums;margin-top:2px;}
    .pdoc-narr{margin-top:14px;background:#FEF9E7;border:1px solid #F0DCA0;border-radius:6px;
      padding:9px 12px;font-size:11.5px;color:#926B0A;line-height:1.5;}
    .pdoc-foot{margin-top:26px;padding-top:12px;border-top:1px solid var(--pd-border);
      text-align:center;font-size:10.5px;color:var(--pd-gray);}
    .pdoc-foot.split{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;text-align:left;}
    .pdoc-foot.split .brand{font-weight:700;white-space:nowrap;}
    /* Inside a printed document a long description wraps like it does on paper. The
       list-table ellipsis rules above are for LIST views and must not reach in here. */
    .pdoc .table-wrap > table tbody td:first-child,
    .pdoc .table-wrap > table th:not(:first-child),
    .pdoc .table-wrap > table td:not(:first-child){
      white-space:normal;max-width:none;overflow:visible;text-overflow:clip;
    }
    .pdoc .table-wrap > table .num{white-space:nowrap;}
    body.dark-mode .pdoc{color:var(--pd-main);}
    @media (max-width:767px){
      .pdoc{padding:20px 16px;font-size:12.5px;}
      .pdoc-top,.pdoc-parties{flex-direction:column;}
      .pdoc-type,.pdoc-num,.pdoc-metaline,.pdoc-amountdue{text-align:left;}
      .pdoc-ident{max-width:100%;}
      .pdoc-foot.split{flex-direction:column;align-items:flex-start;gap:8px;}
    }
    @media print{ .pdoc{max-width:none;padding:0;} }

    /* ── REPORT CENTRE ────────────────────────────────────────────────────
       A rail of reports on the left, the selected one on the right. The point of
       the layout is that a report is something you READ first — exporting it is an
       afterthought, not the only way to see it. */
    .rc-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:22px;align-items:start;}
    .rc-nav{position:sticky;top:16px;background:var(--bg-card);border:1px solid var(--border);
      border-radius:var(--radius);padding:10px 0;max-height:calc(100vh - 120px);overflow-y:auto;}
    .rc-group{font-size:10px;font-weight:700;letter-spacing:0.09em;text-transform:uppercase;
      color:var(--text-muted);padding:12px 14px 6px;}
    .rc-group:first-child{padding-top:2px;}
    .rc-item{display:block;width:100%;text-align:left;background:none;border:none;cursor:pointer;
      font-size:13px;font-weight:500;color:var(--text-secondary);padding:7px 14px;
      border-left:3px solid transparent;transition:background 0.12s,color 0.12s;}
    .rc-item:hover{background:var(--bg-main);color:var(--text-primary);}
    .rc-item.active{background:var(--bg-main);color:var(--text-primary);font-weight:600;
      border-left-color:var(--accent);}
    .rc-main{min-width:0;}
    .rc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;flex-wrap:wrap;margin-bottom:14px;}
    .rc-title{font-size:21px;font-weight:800;color:var(--text-primary);letter-spacing:-0.4px;}
    .rc-sub{font-size:12.5px;color:var(--text-muted);margin-top:3px;}
    .rc-filters{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin-bottom:16px;}
    .rc-filter{display:flex;flex-direction:column;gap:4px;}
    .rc-filter label{font-size:10.5px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:var(--text-muted);}
    .rc-filter input,.rc-filter select{padding:7px 10px;font-size:13px;width:auto;min-width:132px;}
    .rc-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:18px;}
    .rc-stat{background:var(--bg-main);border-radius:var(--radius-sm);padding:12px 14px;}
    .rc-stat .k{font-size:11px;color:var(--text-muted);font-weight:600;}
    .rc-stat .v{font-size:18px;font-weight:800;color:var(--text-primary);margin-top:3px;font-variant-numeric:tabular-nums;}
    .rc-table-wrap{border:1px solid var(--border);border-radius:var(--radius);overflow-x:auto;background:var(--bg-card);}
    /* Dates were wrapping "17 Aug 2026" over three lines in a narrow column. Nothing in
       a report wraps except the one identity column that legitimately needs to. */
    .rc-table-wrap th,.rc-table-wrap td{white-space:nowrap;}
    .rc-table-wrap td.rc-wide,.rc-table-wrap th.rc-wide{white-space:normal;max-width:260px;}
    .rc-table-wrap table tfoot td{font-weight:800;background:var(--bg-main);border-top:2px solid var(--border);border-bottom:none;}
    .rc-empty{padding:44px 20px;text-align:center;color:var(--text-muted);font-size:13.5px;}
    @media (max-width:900px){
      .rc-layout{grid-template-columns:1fr;gap:14px;}
      .rc-nav{position:static;max-height:none;display:flex;flex-wrap:wrap;gap:4px;padding:10px;}
      .rc-group{width:100%;padding:6px 4px 2px;}
      .rc-item{width:auto;border-left:none;border:1px solid var(--border);border-radius:14px;padding:5px 12px;}
      .rc-item.active{border-color:var(--accent);}
    }

    /* ── SEND DOCUMENT (compose) ──────────────────────────────────────────
       Label-left / field-right rows, the shape every mail composer has, so the
       screen is recognisable before it is read. */
    .send-doc-field{display:grid;grid-template-columns:110px 1fr;gap:14px;align-items:start;
      padding:12px 0;border-bottom:1px solid var(--border-hairline);}
    .send-doc-field > label{font-size:13px;font-weight:600;color:var(--text-secondary);padding-top:8px;}
    .send-doc-field input,.send-doc-field textarea{width:100%;}
    .send-doc-from{font-size:13.5px;font-weight:600;color:var(--text-primary);padding-top:8px;}
    .send-doc-hint{font-size:11.5px;color:var(--text-muted);margin-top:3px;line-height:1.5;}
    .send-doc-attach{display:flex;align-items:center;gap:9px;margin-top:14px;padding:9px 13px;
      background:var(--bg-main);border:1px solid var(--border);border-radius:var(--radius-sm);
      font-size:12.5px;font-weight:600;color:var(--text-primary);width:fit-content;max-width:100%;}
    .send-doc-attach .sz{font-weight:500;color:var(--text-muted);}
    .send-doc-preview-wrap{margin-top:18px;}
    .send-doc-preview-label{font-size:10.5px;font-weight:700;letter-spacing:0.07em;text-transform:uppercase;
      color:var(--text-muted);margin-bottom:8px;}
    .send-doc-preview{border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;
      max-height:340px;overflow-y:auto;background:#fff;}
    /* The preview holds a real HTML email, which brings its own colours — keep dark
       mode from repainting it, because what is shown must be what is sent. */
    body.dark-mode .send-doc-preview{background:#fff;}
    .send-doc-sent{font-size:11.5px;color:var(--text-muted);margin-top:-2px;width:100%;}
    .send-doc-sent b{color:var(--text-secondary);font-weight:600;}
    @media (max-width:767px){
      .send-doc-field{grid-template-columns:1fr;gap:5px;}
      .send-doc-field > label,.send-doc-from{padding-top:0;}
    }

    /* ── BADGES ── */
    .badge{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:700;letter-spacing:0.01em;}
    .badge-green{background:#DCFCE7;color:#15803D;}
    .badge-amber{background:#FEF9C3;color:#A16207;}
    .badge-red{background:#FEE2E2;color:#B91C1C;}
    .badge-blue{background:#DBEAFE;color:#1D4ED8;}
    .badge-gray{background:#F1F5F9;color:#475569;}
    .badge-purple{background:#EDE9FE;color:#6D28D9;}

    /* ── FORMS ── */
    .form-group{margin-bottom:16px;}
    .form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
    .form-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px;}
    label{display:block;font-size:11.5px;font-weight:600;color:var(--text-secondary);margin-bottom:5px;text-transform:uppercase;letter-spacing:0.05em;}
    input,select,textarea{width:100%;padding:9px 12px;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:13.5px;font-family:var(--font);color:var(--text-primary);background:white;transition:border-color 0.15s,box-shadow 0.15s;outline:none;}
    input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(98,123,252,0.18);}
    textarea{resize:vertical;min-height:80px;}
    input[readonly]{background:var(--bg-main);color:var(--text-secondary);cursor:default;border-color:var(--border);}

    /* ── MODAL ── */
    .modal-overlay{display:none;position:fixed;inset:0;background:rgba(15,23,42,0.55);backdrop-filter:blur(4px);z-index:200;align-items:center;justify-content:center;padding:20px;}
    .modal-overlay.open{display:flex;}
    .modal{background:white;border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);width:100%;max-width:540px;max-height:90vh;overflow-y:auto;animation:slideUp 0.22s cubic-bezier(0.34,1.12,0.64,1);}
    .modal-lg{max-width:820px;}
/* Full-window modal, for the document editors (invoice, quote). These carry a
   seven-column line-item table plus totals and were being squeezed into an 820px
   dialog, so the columns truncated and Product/Service and Description had to be
   stacked. QuickBooks opens invoice entry as a full window rather than a dialog for
   the same reason. Header and footer stay put; only the body scrolls, so the Save
   buttons are always reachable without scrolling to the bottom of a long invoice. */
.modal-full{max-width:1600px;width:100%;height:calc(100vh - 40px);max-height:none;display:flex;flex-direction:column;overflow:hidden;}
.modal-full .modal-header,.modal-full .modal-footer{flex:0 0 auto;}
.modal-full .modal-body{flex:1 1 auto;overflow-y:auto;padding:24px 30px;}
    .modal-header{padding:22px 26px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;background:linear-gradient(135deg,var(--primary-dark) 0%,var(--primary) 60%,#2D3A7A 100%);border-radius:var(--radius-lg) var(--radius-lg) 0 0;}
    .modal-title{font-size:16px;font-weight:700;color:white;letter-spacing:-0.2px;}
    .modal-close{background:rgba(255,255,255,0.15);border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.8);line-height:1;padding:0;width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;transition:all 0.15s;}
    .modal-close:hover{background:rgba(255,255,255,0.25);color:white;}
    .modal-body{padding:26px;}
    .modal-footer{padding:16px 26px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:10px;background:var(--bg-main);border-radius:0 0 var(--radius-lg) var(--radius-lg);}
    @keyframes slideUp{from{transform:translateY(24px) scale(0.98);opacity:0;}to{transform:translateY(0) scale(1);opacity:1;}}

    /* ── LINE ITEMS ── */
    .line-items-table,.cn-line-items-table{width:100%;border-collapse:collapse;margin-bottom:10px;}
    .line-items-table th,.cn-line-items-table th{background:var(--bg-main);padding:8px 6px;font-size:10px;}
    .line-items-table td,.cn-line-items-table td{padding:5px 3px;border-bottom:none;}
    .line-items-table td input,.line-items-table td select,.cn-line-items-table td input,.cn-line-items-table td select{padding:7px 8px;font-size:13px;}
    .line-items-table tbody tr:hover td,.cn-line-items-table tbody tr:hover td{background:transparent;}
    /* The document editors are dense working grids, not reading lists — keep their
       original tighter rhythm rather than inheriting the roomier list padding. */
    .line-items-table th,.cn-line-items-table th{padding:8px 10px;}
    .line-items-table td,.cn-line-items-table td{padding:8px 10px;}
    .remove-btn{background:none;border:none;color:var(--danger);cursor:pointer;font-size:20px;padding:2px 4px;line-height:1;}

    /* ── TOTALS ── */
    .totals-box{background:var(--bg-main);border-radius:var(--radius-sm);padding:16px 18px;margin-top:14px;border:1px solid var(--border);}
    .total-row{display:flex;justify-content:space-between;gap:10px;padding:5px 0;font-size:13.5px;}
    .total-row > span:last-child{overflow-wrap:break-word;word-break:break-word;text-align:right;}
    .total-label{color:var(--text-secondary);}
    .total-row.grand{border-top:2px solid var(--border);margin-top:10px;padding-top:12px;font-size:clamp(14px,3vw,18px);font-weight:800;color:var(--text-primary);letter-spacing:-0.3px;font-variant-numeric:tabular-nums;}

    /* ── TABS ── */
    .tabs{display:flex;gap:1px;background:var(--bg-main);border-radius:var(--radius-sm);padding:4px;width:fit-content;margin-bottom:20px;border:1px solid var(--border);}
    .tab{padding:6px 16px;border-radius:6px;cursor:pointer;font-size:12.5px;font-weight:500;color:var(--text-muted);transition:all 0.15s;user-select:none;}
    .tab:hover{color:var(--text-secondary);}
    .tab.active{background:white;color:var(--accent-dark);font-weight:700;box-shadow:0 1px 4px rgba(15,23,42,0.08);}

    /* ── CLIENTS ── */
    .clients-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(256px,1fr));gap:16px;}
    .client-card{background:var(--bg-card);border:1.5px solid var(--border);border-radius:var(--radius);padding:22px;cursor:pointer;transition:all 0.18s cubic-bezier(0.4,0,0.2,1);box-shadow:var(--shadow);}
    .client-card:hover{border-color:var(--accent);box-shadow:var(--shadow-md);transform:translateY(-2px);}
    .client-avatar{width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,var(--primary) 0%,var(--accent) 100%);color:white;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:800;margin-bottom:14px;box-shadow:0 2px 8px rgba(26,36,84,0.2);}
    .client-name{font-size:14.5px;font-weight:700;margin-bottom:4px;letter-spacing:-0.2px;}
    .client-detail{font-size:12px;color:var(--text-muted);margin-top:4px;display:flex;align-items:center;gap:5px;}

    /* ── SEARCH ── */
    .search-bar{display:flex;align-items:center;gap:12px;margin-bottom:20px;}
    .search-wrap{position:relative;flex:1;max-width:360px;}
    .search-wrap input{padding-left:36px;}
    .search-ico{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--text-muted);font-size:15px;pointer-events:none;}

    /* ── EMPTY STATE ── */
    .empty-state{text-align:center;padding:64px 20px;}
    .empty-icon{font-size:48px;margin-bottom:14px;opacity:0.7;}
    .empty-title{font-size:16px;font-weight:700;color:var(--text-secondary);margin-bottom:6px;letter-spacing:-0.2px;}
    .empty-sub{font-size:13.5px;color:var(--text-muted);margin-bottom:20px;}

    /* ── SERVER-SIDE LIST PAGER (spec_server_side_lists.md) ── */
    .list-pager{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;font-size:13px;color:var(--text-muted);border-top:1px solid var(--border);}
    .list-pager-btns{display:flex;gap:8px;}
    .list-search-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px;}
    .list-date-input{padding:8px 10px;font-size:13px;width:auto;}
    .spinner{display:inline-block;width:22px;height:22px;border:3px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin 0.7s linear infinite;}
    @keyframes spin{to{transform:rotate(360deg);}}

    /* ── NRS ── */
    .compliance-hero{background:linear-gradient(135deg,var(--primary-dark) 0%,var(--primary) 50%,var(--accent) 100%);border-radius:var(--radius);padding:28px 32px;color:white;margin-bottom:22px;display:flex;align-items:center;justify-content:space-between;}
    .compliance-title{font-size:22px;font-weight:900;margin-bottom:6px;}
    .compliance-sub{font-size:14px;opacity:0.75;}
    .nrs-stamp{font-size:56px;opacity:0.3;}
    .nrs-banner{background:var(--primary-bg);border:1px solid rgba(107,120,240,0.25);border-radius:var(--radius);padding:16px 20px;display:flex;align-items:center;gap:12px;margin-top:16px;}
    .irn-box{background:white;border:1px dashed var(--primary);border-radius:var(--radius-sm);padding:10px 14px;font-family:monospace;font-size:11px;color:var(--primary-dark);word-break:break-all;margin-top:8px;}
    .qr-box{width:72px;height:72px;background:white;border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:36px;flex-shrink:0;}

    /* ── INVOICE DETAIL ── */
    /* The actions used to sit beside the title, so they only had half the width and
       staggered over four rows. Zoho gives the action bar its own full-width line
       under the document number; so do we. */
    .inv-detail-header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;margin-bottom:22px;gap:12px 16px;}
    .inv-meta-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;background:var(--bg-main);border-radius:var(--radius);padding:18px;margin-bottom:22px;}
    .meta-label{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-muted);margin-bottom:5px;}
    .meta-value{font-size:14px;font-weight:600;color:var(--text-primary);}

    /* ── SETTINGS ── */
    .settings-section{margin-bottom:30px;}
    .settings-section-title{font-size:14px;font-weight:700;color:var(--text-primary);margin-bottom:18px;padding-bottom:12px;border-bottom:1.5px solid var(--border);display:flex;align-items:center;gap:8px;letter-spacing:-0.1px;}
    .plan-badge{display:inline-block;background:rgba(255,255,255,0.2);color:white;border:1px solid rgba(255,255,255,0.3);border-radius:20px;padding:3px 10px;font-size:11px;font-weight:700;margin-left:8px;}
    .plan-upgrade-card{background:linear-gradient(135deg,var(--primary-dark) 0%,var(--primary) 40%,var(--accent) 100%);border-radius:var(--radius);padding:22px 26px;color:white;margin-bottom:22px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 4px 16px rgba(107,120,240,0.25);}

    /* ── SETUP GUIDE ── */
    .setup-step{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid var(--border);}
    .setup-step:last-child{border-bottom:none;}
    .step-num{width:28px;height:28px;border-radius:50%;background:var(--primary);color:white;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:900;flex-shrink:0;margin-top:2px;}
    .step-content{flex:1;}
    .step-title{font-weight:700;color:var(--text-primary);margin-bottom:4px;}
    .step-desc{font-size:13px;color:var(--text-secondary);line-height:1.5;}
    .code-inline{background:var(--bg-main);border:1px solid var(--border);border-radius:4px;padding:2px 7px;font-family:monospace;font-size:12px;color:var(--primary-dark);}

    /* ── TOAST ── */
    .toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:8px;}
    .toast{background:#0F172A;color:white;padding:13px 18px;border-radius:var(--radius-sm);font-size:13.5px;box-shadow:0 8px 24px rgba(0,0,0,0.25),0 2px 8px rgba(0,0,0,0.15);display:flex;align-items:center;gap:10px;animation:slideInRight 0.25s cubic-bezier(0.34,1.12,0.64,1);min-width:260px;border:1px solid rgba(255,255,255,0.07);}
    .toast.success{border-left:3px solid var(--success);}
    .toast.error{border-left:3px solid var(--danger);}
    .toast.info{border-left:3px solid var(--info);}
    @keyframes slideInRight{from{transform:translateX(48px);opacity:0;}to{transform:translateX(0);opacity:1;}}

    .divider{border:none;border-top:1px solid var(--border);margin:18px 0;}

    /* ── P&L TABLE ── */
    .pl-section-header td{background:var(--primary);color:white;font-weight:800;font-size:13px;padding:10px 16px;letter-spacing:0.03em;}
    .pl-subtotal td{background:var(--bg-main);font-weight:700;border-top:2px solid var(--border);}
    .pl-grand td{background:var(--primary);color:white;font-weight:900;font-size:15px;border-top:none;}
    .pl-grand.profit td{background:var(--success);}
    .pl-grand.loss td{background:var(--danger);}
    .pl-spacer td{padding:4px;background:transparent;border:none;}
    .pl-item td{padding:10px 16px;}
    .pl-item:hover td{background:var(--bg-main);}
    .pl-vat-row td{color:var(--text-secondary);}

    /* ── TAX CALCULATOR ── */
    .tax-tabs{display:flex;border-bottom:2px solid var(--border);margin-bottom:20px;}
    .tax-tab{padding:10px 20px;cursor:pointer;font-weight:700;font-size:13px;color:var(--text-muted);border-bottom:3px solid transparent;margin-bottom:-2px;transition:all 0.15s;}
    .tax-tab.active{color:var(--primary);border-bottom-color:var(--primary);}
    .tax-panel{display:none;}
    .tax-panel.active{display:block;}
    .tax-result-kpi{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px;}
    .tax-kpi-card{background:var(--bg-main);border-radius:var(--radius-sm);padding:14px 16px;}
    .tax-kpi-label{font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:4px;}
    .tax-kpi-value{font-size:clamp(13px,1.4vw,18px);font-weight:800;color:var(--primary);font-family:var(--font);letter-spacing:-0.3px;overflow-wrap:break-word;word-break:break-word;line-height:1.2;}
    .tax-kpi-sub{font-size:11px;color:var(--text-secondary);margin-top:2px;}
    .tax-band-row td{padding:10px 14px;border-bottom:1px solid var(--border);}
    .tax-band-row.active-band td{background:var(--blue-50);}
    .tax-band-row.active-band td:first-child{font-weight:700;color:var(--blue-600);}
    .tax-band-bar{height:8px;border-radius:20px;background:var(--accent);transition:width 0.5s ease;}
    .tax-ladder-row td{padding:9px 14px;border-bottom:1px solid var(--border);font-size:13px;}
    .tax-ladder-row:hover td{background:var(--bg-main);}
    .tax-ladder-row.highlight td{background:var(--blue-50);font-weight:700;color:var(--blue-600);}
    .deduction-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--border);}
    .deduction-row:last-child{border-bottom:none;}
    .deduction-row label{flex:1;font-size:13px;font-weight:600;color:var(--text-primary);}
    .deduction-row .deduction-sub{font-size:11px;color:var(--text-muted);font-weight:400;}
    .deduction-row input{width:160px;text-align:right;}
    .tax-vis-bar{display:flex;height:32px;border-radius:var(--radius-sm);overflow:hidden;margin:12px 0;gap:2px;}
    .tax-vis-segment{display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:white;transition:width 0.5s ease;white-space:nowrap;overflow:hidden;}
    .cit-tier{padding:18px 20px;border-radius:var(--radius);margin-bottom:10px;border:2px solid transparent;transition:all 0.2s;}
    .cit-tier.active-tier{border-color:var(--accent);background:var(--blue-50);}

    /* ── PAGE PANEL SPACING ── */
    /* Adds consistent vertical rhythm between every top-level block on each page */
    .page > .card,
    .page > .panel-grid,
    .page > .kpi-grid,
    .tax-panel > .card,
    .tax-panel > .panel-grid { margin-bottom: 20px; }
    /* kpi-grid already has margin-bottom:22px — override to keep consistent 20px */
    .page > .kpi-grid { margin-bottom: 20px; }
    /* Last child needs no bottom margin — avoids double padding at page bottom */
    .page > *:last-child,
    .tax-panel > *:last-child { margin-bottom: 0; }

    /* ── RECEIPT UPLOAD ── */
    .receipt-upload-zone{border:2px dashed var(--border);border-radius:var(--radius-sm);padding:14px;text-align:center;cursor:pointer;transition:all 0.15s;background:var(--bg-main);}
    .receipt-upload-zone:hover{border-color:var(--accent);background:var(--primary-bg);}
    .receipt-upload-zone input[type=file]{display:none;}
    .receipt-preview{position:relative;margin-top:10px;}
    .receipt-preview img{max-width:100%;max-height:180px;border-radius:var(--radius-sm);border:1px solid var(--border);object-fit:contain;display:block;margin:0 auto;}
    .receipt-remove{position:absolute;top:4px;right:4px;background:var(--danger);color:white;border:none;border-radius:50%;width:22px;height:22px;font-size:13px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1;}
    .receipt-badge{display:inline-flex;align-items:center;gap:3px;color:var(--accent-dark);font-size:12px;cursor:pointer;font-weight:600;}
    .receipt-badge:hover{text-decoration:underline;}
    /* ── RECEIPT VIEWER ── */
    #modal-receipt .modal{max-width:680px;}
    #modal-receipt img{max-width:100%;max-height:70vh;object-fit:contain;border-radius:var(--radius-sm);display:block;margin:0 auto;}

    /* ══════════════════════════════════════════
       RESPONSIVE — HAMBURGER + BACKDROP
    ══════════════════════════════════════════ */
    .sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.55);z-index:99;backdrop-filter:blur(2px);}
    .sidebar-backdrop.show{display:block;}
    .hamburger-btn{display:none;flex-direction:column;justify-content:center;gap:5px;background:none;border:none;cursor:pointer;padding:6px;border-radius:var(--radius-sm);flex-shrink:0;}
    .hamburger-btn span{display:block;width:22px;height:2px;background:var(--text-primary);border-radius:2px;transition:all 0.2s;}
    .sidebar-close-btn{display:none;position:absolute;top:14px;right:14px;background:rgba(255,255,255,0.15);border:none;color:white;font-size:20px;width:30px;height:30px;border-radius:50%;cursor:pointer;z-index:10;align-items:center;justify-content:center;line-height:1;}

    /* ══════════════════════════════════════════
       RESPONSIVE — TABLET  768px–1023px
    ══════════════════════════════════════════ */
    @media (min-width:768px) and (max-width:1023px) {
      :root { --sidebar-width: 200px; }
      /* the list bleed tracks this breakpoint's page padding */
      .list-surface{margin-left:-20px;margin-right:-20px;margin-bottom:-20px;}
      .kpi-grid { grid-template-columns: repeat(2,1fr) !important; }
      .panel-grid { grid-template-columns: 1fr !important; }
      .inv-meta-grid { grid-template-columns: 1fr 1fr !important; }
      .kpi-value { font-size: 22px; }
      .page { padding: 20px; }
      .topbar { padding: 12px 20px; }
      .clients-grid { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }

      /* 3-column inline stat grids (Reports/Tax Calculator) → 2 columns on tablet */
      [style*="grid-template-columns:1fr 1fr 1fr"],
      [style*="grid-template-columns: 1fr 1fr 1fr"],
      [style*="grid-template-columns:repeat(3,1fr)"],
      [style*="grid-template-columns: repeat(3,1fr)"],
      .tax-result-kpi {
        grid-template-columns: repeat(2,1fr) !important;
      }
    }

    /* ══════════════════════════════════════════
       RESPONSIVE — MOBILE  ≤767px
    ══════════════════════════════════════════ */
    @media (max-width:767px) {
      /* Sidebar → off-canvas drawer */
      .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
        z-index: 200;
        width: 260px;
        box-shadow: none;
      }
      .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.35);
      }
      .sidebar-close-btn { display: flex; }
      .hamburger-btn { display: flex; }

      /* Main takes full width */
      .main { margin-left: 0; }

      /* Topbar. The page title is already the largest thing in the hero directly
         below, so repeating it here is the same duplication the page actions had --
         and on a phone it is competing with the search box for the same 60 pixels. */
      .topbar { padding: 10px 14px; }
      .topbar-title { display: none; }
      .topbar-actions .btn { padding: 7px 11px; font-size: 13px; }

      /* Pages */
      .page { padding: 14px; }
      /* no column-chooser toolbar on a phone: it steals space above the fold */
      .col-toolbar{display:none;}
      /* tables become stacked cards at this width — no bleed, no white takeover */
      .page.active:has(> .list-surface){background:transparent;flex:initial;}
      .list-surface, .page-hero + .list-surface{margin:0;}

      /* KPI grids — 2 columns on mobile */
      .kpi-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; margin-bottom: 14px; }
      .kpi-card { padding: 14px; }
      .kpi-icon { font-size: 20px; margin-bottom: 6px; }
      .kpi-value { font-size: 18px; }
      .kpi-label { font-size: 10px; }
      .kpi-sub { font-size: 11px; }

      /* Dashboard side panel — stack */
      .panel-grid { grid-template-columns: 1fr !important; }

      /* Invoice meta — stack */
      .inv-meta-grid { grid-template-columns: 1fr !important; gap: 12px; }
      .inv-detail-header { flex-direction: column; align-items: flex-start; gap: 10px; }
      .inv-detail-header > div:last-child { width: 100%; flex-wrap: wrap; }
      .inv-detail-header .btn { flex: 1; justify-content: center; font-size: 12px; }

      /* Forms — single column */
      .form-row { grid-template-columns: 1fr !important; gap: 0; }
      .form-row-3 { grid-template-columns: 1fr !important; gap: 0; }

      /* Cards */
      .card-header { padding: 12px 14px 10px; flex-wrap: wrap; gap: 8px; }
      .card-body { padding: 14px; }

      /* Clients grid — 1 column */
      .clients-grid { grid-template-columns: 1fr; }

      /* Auth — full screen feel */
      .auth-card { padding: 28px 20px; border-radius: 12px; }

      /* Modals — bottom sheet on mobile */
      .modal-overlay { align-items: flex-end; padding: 0; }
      .modal {
        border-radius: 20px 20px 0 0;
        max-width: 100%;
        max-height: 92vh;
        width: 100%;
        margin: 0;
        animation: slideUp 0.25s ease;
      }
      .modal-lg { max-width: 100%; }
      /* The document editors are already full-window on desktop; on a phone they take
         the whole screen rather than a bottom sheet, since a line-item table needs
         every pixel of height available. */
      .modal-full { max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
      .modal-full .modal-body { padding: 16px; }
      .modal-body { padding: 16px; }
      /* Three buttons with long labels overflow a 390px footer: flex-end justification
         pushed Cancel off the LEFT edge of the screen (quote modal lost half of it).
         Let the row wrap and the buttons share each row instead -- nothing is ever
         pushed off-screen, and a footer that already fits looks the same as before. */
      .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
      /* Some footers (invoice) are a column whose button row is a nested flex div --
         the wrap has to happen on whichever element actually lays the buttons out. */
      .modal-footer > div { flex-wrap: wrap; }
      .modal-footer .btn { flex: 1 1 auto; min-width: 0; }
      .modal-header { padding: 16px 16px 12px; }

      /* Tables — make them scroll smoothly */
      .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
      th, td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }

      /* ── Say that the table scrolls ─────────────────────────────────
         A fade at the right edge that means one thing only: there is more
         that way. It goes the moment you reach the end, so it never lies.
         The shell exists so the fade can sit above content that is moving
         underneath it -- an absolutely positioned child of the scroller
         itself would slide away with the columns. */
      .table-scroll-shell { position: relative; }
      .table-scroll-fade {
        display: block;
        position: absolute; top: 0; right: 0; bottom: 0; width: 28px;
        pointer-events: none; opacity: 0; transition: opacity 0.18s;
        /* `transparent` rather than a hard-coded rgba so the fade follows the card
           colour in dark mode too; gradients interpolate premultiplied, so this does
           not go grey in the middle. */
        background: linear-gradient(to right, transparent 0%, var(--bg-card) 88%);
      }
      .table-scroll-shell.table-scrolls .table-scroll-fade { opacity: 1; }
      .table-scroll-shell.table-scrolls.at-end .table-scroll-fade { opacity: 0; }
      .table-scroll-cue.is-visible {
        display: block;
        font-size: 11.5px; color: var(--text-muted);
        padding: 0 12px 7px; white-space: nowrap;
      }

      /* -- A record list becomes cards --------------------------------
         Eight columns on a 390px screen shows two of them. #107 taught the
         table to say it scrolls sideways, which was the right fix for the
         wrong problem: amount, status and due date were still behind a swipe
         you had to know about.

         Every column is still here, one per line, labelled from its own
         column heading -- so nothing is dropped and nothing can drift.
         Financial statements are deliberately excluded (see CARD_LISTS): the
         comparison down a P&L column IS the information. */
      table.as-cards, table.as-cards > tbody, table.as-cards > tbody > tr, table.as-cards > tbody > tr > td {
        display: block; width: auto;
      }
      table.as-cards > thead { display: none; }
      table.as-cards { border-collapse: separate; }
      table.as-cards > tbody > tr {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 10px 13px;
        margin-bottom: 10px;
      }
      /* :hover sticks after a tap on a touch screen, so the last card you touched
         stayed tinted and looked selected. A card is its own surface anyway. */
      table.as-cards > tbody > tr:hover { background: var(--bg-card); }
      table.as-cards > tbody > tr:hover > td { background: transparent; }
      table.as-cards > tbody > tr > td {
        border: 0;
        padding: 3px 0;
        white-space: normal;
        text-align: right;
        display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
        font-size: 13px;
      }
      table.as-cards > tbody > tr > td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
        color: var(--text-muted); text-align: left;
      }
      /* The first field is what the card is -- an invoice number, a name. It reads as
         a heading rather than as one more labelled line. */
      table.as-cards > tbody > tr > td:first-child {
        display: block; text-align: left;
        font-size: 15px; font-weight: 700; color: var(--text-primary);
        padding-bottom: 7px; margin-bottom: 5px; border-bottom: 1px solid var(--border);
      }
      table.as-cards > tbody > tr > td:first-child::before { display: none; }
      table.as-cards > tbody > tr > td:first-child > a { font-size: 15px; }
      /* A cell with no heading, or the actions cell, is buttons -- a label above a row
         of buttons says nothing the buttons do not. */
      table.as-cards > tbody > tr > td[data-label=""]::before,
      table.as-cards > tbody > tr > td[data-label="Actions"]::before,
      table.as-cards > tbody > tr > td[data-label="Action"]::before,
      table.as-cards > tbody > tr > td[data-label="Match"]::before { display: none; }
      table.as-cards > tbody > tr > td[data-label=""],
      table.as-cards > tbody > tr > td[data-label="Actions"],
      table.as-cards > tbody > tr > td[data-label="Action"],
      table.as-cards > tbody > tr > td[data-label="Match"] {
        justify-content: flex-end; flex-wrap: wrap; gap: 8px;
        padding-top: 8px; margin-top: 5px; border-top: 1px solid var(--border);
      }
      /* An empty cell would otherwise render as a label with nothing after it. */
      table.as-cards > tbody > tr > td:empty { display: none; }
      /* The empty-state sentence is not a record and is not laid out like one. */
      table.as-cards > tbody > tr.card-msg { border: 0; background: none; padding: 0; }
      table.as-cards > tbody > tr.card-msg > td { display: block; text-align: center; }
      table.as-cards > tbody > tr.card-msg > td::before { display: none; }

      /* Tabs */
      .tabs { overflow-x: auto; white-space: nowrap; width: 100%; -webkit-overflow-scrolling: touch; }

      /* ── Touch targets ──────────────────────────────────────────────
         Measured on a phone before this: status tabs and row Edit/Delete
         buttons were 25–27px tall and invoice-number links 16px. Apple asks
         for 44, Google for 48. Fiddly on a payments screen is how somebody
         taps Delete meaning Edit. Nothing here applies above 767px. */
      .tab { padding: 6px 14px; font-size: 12px; min-height: 44px; display: inline-flex; align-items: center; }
      .btn { min-height: 44px; }
      .btn-sm { min-height: 44px; }
      .row-menu-btn { min-height: 44px; }
      .row-menu button { min-height: 44px; }
      /* The whole row height becomes the target for a row link, not just the
         text -- the cell padding shrinks by the same amount the link grows, so
         a list is no taller than it was. */
      td { padding-top: 3px; padding-bottom: 3px; }
      td > a { display: inline-flex; align-items: center; min-height: 44px; }
      /* 26 letters at 44px each would wrap into four rows and push the client
         list off the screen; one scrolling row keeps both the target size and
         the space. */
      #clients-az-strip { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }

      /* #107 hid the duplicate hero button on phones. There is no duplicate
         anywhere now -- page actions live on the page and the top bar is global --
         so the special case is gone and one rule covers both screen sizes. */
      .page-hero-actions { flex-wrap: wrap; }

      /* Secondary hero actions that must not push the first record below the fold on a
         phone (see phone-reskin.spec "first record above the fold"). "+ New repeating
         invoice" stays discoverable on phones via the Recurring tab button, global search
         and Quick Actions -- it just doesn't earn a row of hero furniture here. */
      .hide-phone { display: none !important; }

      /* ── Date ranges stack ──────────────────────────────────────────
         At 390px the Year End header put FROM: and its input on one line,
         orphaned TO:, and dropped the second input onto its own. */
      .hero-date-actions { width: 100%; align-items: stretch !important; }
      .hero-date-actions > .btn { width: 100%; justify-content: center; }
      .date-range-controls { width: 100%; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important; }
      .date-range-controls > label { text-align: left; }
      .date-range-controls input, .date-range-controls select { width: 100% !important; }
      .date-range-controls > span { width: 100%; }
      /* The list filter bars have the same "from [date] to [date]" shape as the
         hero ranges and wrapped the same way -- the search box, the first date
         and a stranded "to" on one line, the second date below it. */
      .list-search-bar { flex-direction: column; align-items: stretch; }
      .list-search-bar .search-wrap { max-width: 100%; }
      .list-search-bar .list-date-input { width: 100%; }
      /* Reports' custom range is a span the app shows and hides; only its
         direction is touched, never its display. */
      #report-period-custom-wrap, #report-period-quarter-wrap { flex-direction: column !important; align-items: stretch !important; }
      #report-period-custom-wrap > span { text-align: center; }

      /* Search bar */
      .search-bar { flex-direction: column; align-items: stretch; }
      .search-wrap { max-width: 100%; }

      /* Settings plan card */
      .plan-upgrade-card { flex-direction: column; align-items: flex-start; gap: 12px; }

      /* NRS hero */
      .compliance-hero { flex-direction: column; gap: 8px; padding: 20px; }
      .nrs-stamp { display: none; }

      /* The top bar carries only what is true on every page now -- search, dark mode,
         profile -- so there is room for the search box that used to be hidden here.
         Both of these were working features made invisible by screen size, which is
         the same mistake as hiding a menu item: somebody picks up a phone, sees no
         search and no export, and concludes Feezka has neither. */
      #topbar-actions { gap: 6px; }
      #global-search-wrap { display: flex !important; flex: 1; min-width: 0; }
      #global-search-input { width: 100% !important; min-width: 0; }

      /* Setup steps */
      .setup-step { flex-direction: column; gap: 8px; }

      /* Expense category breakdown */
      #expense-cat-breakdown { padding: 8px; }

      /* Un-classed inline multi-column grids scattered through Reports, Tax
         Calculator, Payroll and the invoice statement template — collapse to
         a single column so labels/values don't get crushed on narrow screens */
      [style*="grid-template-columns:1fr 1fr 1fr"],
      [style*="grid-template-columns: 1fr 1fr 1fr"],
      [style*="grid-template-columns:repeat(3,1fr)"],
      [style*="grid-template-columns: repeat(3,1fr)"],
      [style*="grid-template-columns:1fr 1fr"],
      [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
      }

      /* Tax calculator result KPI strip — 3 col → 1 col */
      .tax-result-kpi { grid-template-columns: 1fr !important; }

      /* Deduction rows (tax calculator) — stack label above input instead of
         forcing a fixed 160px input next to a wrapping label */
      .deduction-row { flex-direction: column; align-items: flex-start; gap: 6px; }
      .deduction-row input { width: 100%; text-align: left; }
    }

    /* ══════════════════════════════════════════
       RESPONSIVE — VERY SMALL  ≤400px
    ══════════════════════════════════════════ */
    @media (max-width:400px) {
      .kpi-grid { grid-template-columns: 1fr 1fr !important; }
      .kpi-value { font-size: 16px; }
      .auth-card { padding: 22px 16px; border-radius: 10px; }
    }

    /* Printing was hardcoded to #page-invoice-detail, so Ctrl+P on a quote, receipt or
       purchase order printed a blank sheet. Print whichever page is actually open. */
    @media print {
      .sidebar,.topbar,.no-print{display:none!important;}
      .main{margin-left:0;}
      .page{display:none!important;padding:0;}
      .page.active{display:block!important;padding:0;}
    }

    /* ═══════════════════════════════════════
       REDESIGN POLISH LAYER
    ═══════════════════════════════════════ */

    /* Dark toggle refinement */
    #dark-toggle{background:none;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:6px 10px;cursor:pointer;font-size:15px;color:var(--text-secondary);transition:all 0.15s;}
    #dark-toggle:hover{background:var(--bg-main);border-color:var(--blue);color:var(--blue);}

    /* Search bar */
    .search-bar{display:flex;align-items:center;gap:12px;margin-bottom:20px;}
    .search-wrap{position:relative;flex:1;max-width:380px;}
    .search-wrap input{padding-left:38px;background:var(--bg-card);border:1.5px solid var(--border);}
    .search-wrap input:focus{border-color:var(--accent);background:white;}
    .search-ico{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-muted);font-size:14px;pointer-events:none;}

    /* NRS hero refinement */
    .compliance-hero{background:linear-gradient(135deg,#070E22 0%,var(--primary) 50%,var(--accent) 100%);border-radius:var(--radius);padding:30px 34px;color:white;margin-bottom:22px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 4px 20px rgba(55,87,251,0.2);}
    .compliance-title{font-size:21px;font-weight:800;margin-bottom:6px;letter-spacing:-0.3px;}
    .compliance-sub{font-size:13.5px;opacity:0.75;}

    /* Invoice detail meta grid */
    .inv-meta-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:20px;background:var(--bg-main);border-radius:var(--radius);padding:20px;margin-bottom:24px;border:1px solid var(--border);}
    .meta-label{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.07em;color:var(--text-muted);margin-bottom:5px;}
    .meta-value{font-size:14px;font-weight:600;color:var(--text-primary);}

    /* Line items table */
    .line-items-table,.cn-line-items-table{width:100%;border-collapse:collapse;margin-bottom:10px;}
    .line-items-table th,.cn-line-items-table th{background:var(--bg-main);padding:9px 8px;font-size:10px;color:var(--text-muted);border-bottom:1.5px solid var(--border);}
    .line-items-table td,.cn-line-items-table td{padding:5px 3px;border-bottom:none;}
    .line-items-table td input,.line-items-table td select,.cn-line-items-table td input,.cn-line-items-table td select{padding:8px 9px;font-size:13px;border-radius:var(--radius-sm);}
    .line-items-table tbody tr:hover td,.cn-line-items-table tbody tr:hover td{background:transparent;}
    .remove-btn{background:none;border:none;color:var(--danger);cursor:pointer;font-size:18px;padding:4px 6px;line-height:1;border-radius:6px;transition:background 0.1s;}
    .remove-btn:hover{background:var(--danger-bg);}

    /* Catalogue combobox -- Product/Service field on invoice & quote lines */
    .li-combo{position:relative;}
    .li-combo input{width:100%;padding-right:26px !important;}
    .li-combo-chevron{position:absolute;right:2px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--text-muted);padding:4px;line-height:1;border-radius:6px;display:flex;}
    .li-combo-chevron:hover{background:var(--bg-main);}
    .li-save-slot:empty{display:none;}
    .li-save-as-product-btn{background:none;border:none;color:var(--accent);cursor:pointer;font-size:11px;font-weight:600;padding:2px 0;margin-top:2px;}
    .li-save-as-product-btn:hover{text-decoration:underline;}
    .catalogue-combo-panel{position:fixed;display:none;background:var(--bg-card);border:1.5px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);max-height:280px;overflow-y:auto;z-index:4000;}
    .catalogue-combo-row{padding:8px 12px;cursor:pointer;border-bottom:1px solid var(--border);}
    .catalogue-combo-row:last-child{border-bottom:none;}
    .catalogue-combo-row:hover,.catalogue-combo-row.hi{background:var(--bg-main);}
    .catalogue-combo-row-name{font-size:13px;font-weight:600;color:var(--text-primary);}
    .catalogue-combo-row-sub{font-size:11px;color:var(--text-muted);margin-top:1px;}
    .catalogue-combo-empty{padding:14px 12px;font-size:12px;color:var(--text-muted);text-align:center;font-style:italic;}
    .field-error{color:var(--danger);font-size:11px;margin-top:4px;}

    /* IRN / QR */
    .irn-box{background:white;border:1px dashed rgba(55,87,251,0.4);border-radius:var(--radius-sm);padding:10px 14px;font-family:monospace;font-size:11px;color:var(--primary-dark);word-break:break-all;margin-top:8px;}
    .qr-box{width:72px;height:72px;background:white;border:1px solid var(--border);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:34px;flex-shrink:0;}

    /* Setup steps */
    .step-num{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--blue-600) 0%,var(--blue) 100%);color:var(--btn-ink);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;flex-shrink:0;margin-top:2px;}

    /* P&L section headers */
    .pl-section-header td{background:linear-gradient(90deg,var(--primary) 0%,var(--primary-light) 100%);color:white;font-weight:700;font-size:13px;padding:10px 16px;letter-spacing:0.03em;}
    .pl-grand td{background:linear-gradient(90deg,var(--primary-dark) 0%,var(--primary) 100%);color:white;font-weight:800;font-size:15px;border-top:none;}
    .pl-grand.profit td{background:linear-gradient(90deg,#059669 0%,var(--success) 100%);}
    .pl-grand.loss td{background:linear-gradient(90deg,#DC2626 0%,var(--danger) 100%);}

    /* Tax tabs */
    .tax-tab.active{color:var(--accent-dark);border-bottom-color:var(--accent);}

    /* Plan upgrade card button */
    .plan-upgrade-card .btn{background:white;color:var(--primary);font-weight:700;}
    .plan-upgrade-card .btn:hover{background:var(--blue-50);color:var(--blue-600);}

    /* Global search results */
    #global-search-results{border-radius:var(--radius);border:1.5px solid var(--border);box-shadow:var(--shadow-lg);overflow:hidden;}
    /* Search finds pages and actions as well as records now, so results are grouped
       and keyboard-navigable -- the styling moved out of inline attributes so a
       highlighted row can actually be styled. */
    #global-search-results{max-height:60vh;overflow-y:auto;}
    .gs-group{padding:6px 14px 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--text-muted);background:var(--bg-main);border-bottom:1px solid var(--border);}
    .gs-item{display:flex;align-items:center;gap:10px;padding:9px 14px;cursor:pointer;border-bottom:1px solid var(--border);}
    .gs-item:hover,.gs-item.gs-active{background:var(--blue-50);}
    .gs-item.gs-active{box-shadow:inset 3px 0 0 var(--accent);}
    .gs-icon{font-size:16px;display:flex;align-items:center;color:var(--text-muted);}
    .gs-text{flex:1;min-width:0;}
    .gs-title{font-size:13px;font-weight:600;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
    .gs-sub{font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
    .gs-more{padding:8px 14px;font-size:11px;color:var(--text-muted);text-align:center;}

    /* Receipt upload zone */
    .receipt-upload-zone{border:2px dashed var(--border);border-radius:var(--radius-sm);padding:16px;text-align:center;cursor:pointer;transition:all 0.15s;background:var(--bg-main);}
    .receipt-upload-zone:hover{border-color:var(--accent);background:var(--blue-50);}

    /* NRS banner */
    .nrs-banner{background:linear-gradient(135deg,var(--blue-50) 0%,rgba(55,87,251,0.03) 100%);border:1.5px solid var(--blue-100);border-radius:var(--radius);padding:16px 20px;display:flex;align-items:center;gap:12px;margin-top:16px;}

    /* Mobile responsive sidebar improvement */
    @media (max-width:767px) {
      .sidebar{width:272px;}
    }

    /* ═══════════════════════════════════════
       DASHBOARD HERO — greeting + KPI row on the plain page surface
       (no panel background; KPI cards are plain white .kpi-card)
    ═══════════════════════════════════════ */
    .dashboard-hero {
      margin-bottom: 28px;
    }
    .dashboard-hero-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 24px;
    }
    .dashboard-hero-eyebrow {
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--text-muted);
      margin-bottom: 6px;
    }
    .dashboard-hero-title {
      font-size: 23px;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.025em;
    }
    .dashboard-hero-date {
      font-size: 13px;
      color: var(--text-secondary);
      text-align: right;
      line-height: 1.6;
      margin-top: 4px;
    }
    .dashboard-hero .kpi-grid { gap: 14px; }

    /* ── Settings section title accent dot ── */
    .settings-section-title::before {
      content: '';
      display: inline-block;
      width: 8px; height: 8px;
      background: var(--accent);
      border-radius: 50%;
      margin-right: 2px;
      flex-shrink: 0;
    }
    /* NRS hero shimmer — compliance-hero stays on its dark navy/blue gradient
       this run, so its accent line uses the on-navy blue, not the interactive blue */
    .compliance-hero { position: relative; }
    .compliance-hero::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, transparent, var(--blue-onnavy), transparent);
      border-radius: var(--radius) var(--radius) 0 0;
    }
    /* Client card hover */
    .client-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(98,123,252,0.14); }
    /* Modal header shimmer at very top — modal header stays on the dark navy
       gradient this run, so it uses the on-navy blue */
    .modal-header { position: relative; }
    .modal-header::after {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; height: 2px;
      background: linear-gradient(90deg, transparent, var(--blue-onnavy), transparent);
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .topbar { border-bottom: 1px solid var(--border); }

    /* ── AUTH SCREEN — demo badge accent ── */
    .demo-badge { border-color: var(--blue-100); color: var(--blue-600); }
    .demo-badge:hover { background: var(--blue); color: var(--btn-ink); border-color: var(--blue); }

    /* ── RESPONSIVE: hero on mobile ── */
    @media (max-width: 767px) {
      .dashboard-hero { margin: -14px -14px 20px -14px; padding: 22px 14px 28px; }
      .dashboard-hero .kpi-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; }
      .dashboard-hero-title { font-size: 17px; }
      .dashboard-hero-header { flex-direction: column; gap: 4px; }
      .dashboard-hero-date { text-align: left; }
    }

    /* ═══════════════════════════════════════
       UNIVERSAL PAGE HERO — all pages
    ═══════════════════════════════════════ */
    /* ── The band is gone ─────────────────────────────────────────────
       Every page except the Dashboard used to open with a deep navy band running the
       full width of the content. Daniel's note, and it is the right one: the Dashboard
       is the page he likes, and the Dashboard is the one page with no band. Navy is the
       app's frame -- the sidebar -- not a stripe laid across the work.

       So the hero keeps its job (eyebrow, title, the page's actions, its figures) and
       loses its colour. Everything inside it that had been given white or translucent
       treatment to survive on navy goes back to the ordinary light-surface palette,
       which also means the brand rule stops being flipped here: on a white surface the
       action is navy with white ink (15.75:1), the same as everywhere else in the app. */
    .page-hero {
      margin: -28px -28px 22px -28px;
      padding: 24px 28px 20px;
      background: var(--bg-card);
      border-bottom: 1px solid var(--border);
      position: relative;
    }
    .page-hero-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }
    .page-hero-header + .kpi-grid,
    .page-hero-header + .hero-stat-pills { margin-top: 18px; }
    .page-hero-eyebrow {
      font-size: 10.5px; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.14em; color: var(--accent); margin-bottom: 5px;
    }
    .page-hero-title {
      font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.4px;
    }
    .page-hero-sub {
      font-size: 13px; color: var(--text-muted); margin-top: 5px; line-height: 1.45;
    }
    /* The KPI cards in a hero are now just KPI cards. The glassmorphism only ever
       existed so they could be seen on navy. */
    .page-hero .kpi-grid { gap: 12px; }
    .page-hero .kpi-card { padding: 14px 16px; }
    .page-hero .kpi-value { font-size: clamp(15px,1.5vw,22px); }
    /* Stat pills — for pages without full KPI grids */
    .hero-stat-pills { display: flex; flex-wrap: wrap; gap: 8px; }
    .hero-pill, .hero-stat-pill {
      display: inline-flex; align-items: center; gap: 6px;
      background: var(--bg-main);
      border: 1px solid var(--border);
      border-radius: 20px; padding: 5px 14px;
      font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
    }
    .hero-pill.gold { color: var(--accent-dark); border-color: #C7D2FE; background: var(--primary-bg); }
    /* Hero right-side action area. margin-left:auto rather than relying on the
       header's space-between: the Audit Log hero has a third child after the actions
       (a decorative watermark icon), which left the CSV button stranded mid-band. */
    .page-hero-actions {
      display: flex; gap: 10px; align-items: center; flex-shrink: 0; margin-top: 2px;
      margin-left: auto;
    }
    /* Plan badge in settings hero */
    .settings-plan-tag {
      background: var(--primary-bg); border: 1px solid #C7D2FE;
      border-radius: 20px; padding: 6px 16px; font-size: 12px; font-weight: 700;
      color: var(--accent-dark); white-space: nowrap; margin-top: 6px; display: inline-block;
    }
    /* The watermark only read as decoration against navy. On white it is a grey smudge. */
    .page-hero-icon { display: none; }
    /* The Year End range inputs were written inline as white-on-translucent to sit on
       the band. There is no band. */
    .page-hero .date-range-controls label { color: var(--text-secondary) !important; }
    .page-hero .date-range-controls input,
    .page-hero .date-range-controls select {
      background: var(--bg-main) !important;
      border: 1px solid var(--border) !important;
      color: var(--text-primary) !important;
    }
    /* Tabs inside page (below hero) */
    .page-hero + .tabs { margin-top: 0; }
    /* Responsive */
    @media (max-width: 767px) {
      .page-hero { margin: -14px -14px 20px -14px; padding: 20px 14px 28px; }
      .page-hero .kpi-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; }
      .page-hero-title { font-size: 18px; }
      .page-hero-header { flex-direction: column; gap: 8px; }
      .page-hero-actions { flex-wrap: wrap; }
    }

    /* ═══════════════════════════════════════
       CRM — KANBAN PIPELINE BOARD
    ═══════════════════════════════════════ */
    .crm-board {
      display: grid;
      grid-template-columns: repeat(6, minmax(220px, 1fr));
      gap: 14px;
      overflow-x: auto;
      padding-bottom: 8px;
      align-items: start;
    }
    .crm-column {
      background: var(--bg-main);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 12px;
      min-height: 140px;
      transition: background 0.15s, border-color 0.15s;
    }
    .crm-column.drag-over {
      background: var(--accent-light);
      border-color: var(--accent);
    }
    .crm-column-header {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 4px;
    }
    .crm-column-dot {
      width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
    }
    .crm-column-title {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-primary);
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .crm-column-count {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-muted);
      background: var(--bg-card);
      border-radius: 10px;
      padding: 1px 7px;
      flex-shrink: 0;
    }
    .crm-column-total {
      font-size: 11px;
      color: var(--text-muted);
      font-family: monospace;
      margin-bottom: 10px;
    }
    .crm-column-body {
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-height: 60px;
    }
    .crm-column-empty {
      text-align: center;
      color: var(--text-muted);
      font-size: 11.5px;
      font-style: italic;
      padding: 16px 4px;
    }
    .crm-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      cursor: grab;
      box-shadow: var(--shadow);
      transition: box-shadow 0.15s, transform 0.15s, opacity 0.15s;
    }
    .crm-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
    }
    .crm-card.dragging {
      opacity: 0.4;
    }
    .crm-card-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 2px;
    }
    .crm-card-company {
      font-size: 11.5px;
      color: var(--text-secondary);
      margin-bottom: 4px;
    }
    .crm-card-value {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-primary);
      font-family: monospace;
      margin-bottom: 6px;
    }
    .crm-card-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
    }
    .crm-card-source {
      font-size: 10px;
      color: var(--text-muted);
      background: var(--bg-main);
      border-radius: 10px;
      padding: 2px 8px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .crm-card-actions {
      display: flex;
      gap: 4px;
      flex-shrink: 0;
    }
    .crm-card-btn {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 13px;
      padding: 2px 4px;
      line-height: 1;
      border-radius: 5px;
      color: var(--text-muted);
      transition: background 0.1s;
    }
    .crm-card-btn:hover {
      background: var(--bg-main);
    }

    /* Lead score badge */
    .crm-card-name-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 6px;
      margin-bottom: 2px;
    }
    .crm-score-badge {
      font-size: 9.5px;
      font-weight: 700;
      white-space: nowrap;
      padding: 1px 6px;
      border-radius: 10px;
      flex-shrink: 0;
    }
    .crm-score-badge.hot  { background: rgba(239,68,68,0.12);  color: #B91C1C; }
    .crm-score-badge.warm { background: rgba(245,158,11,0.14); color: #92400E; }
    .crm-score-badge.cold { background: rgba(59,130,246,0.12); color: #1D4ED8; }

    /* Lead activity log (inside lead modal) */
    #lead-activity-section {
      margin-top: 18px;
      padding-top: 16px;
      border-top: 1.5px solid var(--border);
    }
    #lead-activity-section .settings-section-title {
      margin-bottom: 10px;
      padding-bottom: 0;
      border-bottom: none;
    }
    .lead-activity-add-row {
      display: flex;
      gap: 6px;
      margin-bottom: 10px;
    }
    .lead-activity-add-row select {
      width: auto;
      flex-shrink: 0;
    }
    #lead-activity-feed {
      max-height: 220px;
      overflow-y: auto;
    }

    /* Mobile: board becomes horizontally scrollable single-row columns */
    @media (max-width: 767px) {
      .crm-board {
        grid-auto-flow: column;
        grid-template-columns: none;
        grid-auto-columns: minmax(200px, 78vw);
      }
    }

    /* ═══════════════════════════════════════
       RECEIPTS GALLERY
    ═══════════════════════════════════════ */
    .receipts-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 16px;
    }
    .receipt-thumb-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      cursor: pointer;
      box-shadow: var(--shadow);
      transition: box-shadow 0.18s, transform 0.18s;
    }
    .receipt-thumb-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }
    .receipt-thumb-img-wrap {
      width: 100%;
      height: 140px;
      background: var(--bg-main);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }
    .receipt-thumb-img-wrap img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .receipt-thumb-body {
      padding: 10px 12px 12px;
    }
    .receipt-thumb-desc {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 4px;
    }
    .receipt-thumb-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 10.5px;
      color: var(--text-muted);
      margin-bottom: 6px;
    }
    .receipt-thumb-amount {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-primary);
      font-family: monospace;
    }

    /* ── Dark mode: navy text on a dark card ─────────────────────────────
       Row links are written inline as color:var(--primary), which is 1.08:1 against
       the dark card behind them. Nothing short of !important beats an inline style,
       so it is used here deliberately and nowhere else. */
    body.dark-mode .table-wrap td a,
    body.dark-mode .table-wrap th a { color: var(--primary-ink) !important; }

    /* ══════════════════════════════════════════
       RESPONSIVE — PHONE DENSITY
       ------------------------------------------
       Measured before this block, on a 390x844 screen: the first invoice in the
       list sat 545px down. Two thirds of the screen went on chrome -- a hero
       carrying desktop padding, three action buttons at desktop size wrapping onto
       two rows, a stat pill row, tabs, and a filter bar that put the search box,
       the first date, an orphaned "to" and the second date on four separate rows.

       Nothing here removes anything. It is the same hero, the same three buttons,
       the same two dates, at a size that suits the screen they are on. 44px touch
       targets from #107 are preserved throughout -- density is about padding and
       type scale, not about making things harder to hit.
    ══════════════════════════════════════════ */
    @media (max-width: 767px) {
      .page { padding: 12px; }

      /* Hero: 227px of it, for a title and three buttons. */
      .page-hero { margin: -12px -12px 14px -12px; padding: 14px 12px 16px; }
      .page-hero::after { display: none; }
      .page-hero-eyebrow { font-size: 9.5px; letter-spacing: 0.12em; margin-bottom: 3px; }
      .page-hero-title { font-size: 17px; }
      .page-hero-sub { font-size: 12px; margin-top: 3px; }
      /* The header stacks on a phone, so DOM order becomes visual order and the
         action would sit above the title on any page whose markup puts it first. */
      .page-hero-header { gap: 10px; }
      .page-hero-header > div:first-child { order: 1; }
      .page-hero-actions { order: 2; }
      .page-hero-header + .kpi-grid,
      .page-hero-header + .hero-stat-pills { margin-top: 12px; }
      .page-hero-icon { display: none; }
      /* The three buttons shared a row on a laptop and took three rows here. They
         share a row again -- still 44px tall, just not 60px wide of padding each. */
      /* Three buttons fit one row at this size; a fourth wraps to a second rather
         than running off the screen, which is what nowrap did to Record Expense. */
      .page-hero-actions { width: 100%; gap: 8px; flex-wrap: wrap; }
      .page-hero-actions .btn { flex: 1 1 auto; justify-content: center; padding: 8px 10px; font-size: 12.5px; }
      .hero-stat-pills { gap: 6px; }
      .hero-pill { padding: 4px 11px; font-size: 11.5px; }
      .page-hero .kpi-card { padding: 12px 11px; }
      .page-hero .kpi-value { font-size: 16px; }

      /* Dashboard tiles: six of them at 145px each is 440px of scrolling before
         anything you can act on. */
      .kpi-card { padding: 11px; }
      .kpi-icon-wrap { width: 30px; height: 30px; }
      .kpi-value { font-size: 17px; }
      .kpi-sub { font-size: 10.5px; line-height: 1.35; }
      .dashboard-hero-eyebrow { font-size: 9.5px; }
      .dashboard-hero-title { font-size: 16px; }

      .tabs { margin-bottom: 10px; }
      .tab { padding: 5px 12px; font-size: 12.5px; }
      .card { margin-bottom: 12px; }
      .card-header { padding: 11px 12px 9px; }
      .card-title { font-size: 14px; }
      .card-body { padding: 12px; }

      /* "from [date] to [date]" belongs on one line. It was four. */
      .list-search-bar { flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
      .list-search-bar .search-wrap { flex: 1 1 100%; max-width: 100%; }
      .list-search-bar .list-date-input { flex: 1 1 0; width: auto !important; min-width: 0; }
      .list-search-bar > span { flex: 0 0 auto; }
    }

    /* ── Sync failure banner (make failure loud, 2026-08-17) ── */
    #sync-status-banner{position:fixed;bottom:16px;right:16px;z-index:400;display:flex;flex-direction:column;gap:8px;max-width:420px;}
    .sync-banner{border-radius:var(--radius-sm);padding:10px 14px;font-size:12.5px;line-height:1.45;box-shadow:var(--shadow-md);}
    .sync-banner-failed{background:#FEF2F2;border:1px solid #FCA5A5;color:#7F1D1D;}
    .sync-banner-pending{background:#FFFBEB;border:1px solid #FDE68A;color:#78350F;}
    .sync-banner-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-weight:700;margin-bottom:4px;}
    .sync-banner-head .btn{background:#B91C1C;color:#fff;border:none;padding:4px 10px;font-size:11.5px;}
    .sync-banner-row{display:flex;align-items:baseline;gap:6px;padding:3px 0;border-top:1px solid rgba(0,0,0,0.06);}
    .sync-banner-row b{white-space:nowrap;}
    .sync-banner-dismiss{margin-left:auto;background:none;border:none;color:inherit;font-size:14px;cursor:pointer;opacity:0.6;}
    .sync-banner-dismiss:hover{opacity:1;}

    /* ── Item form: Zoho-style type radios + HSN/ISIC typeahead (17 Aug) ── */
    .radio-pill-group{display:flex;gap:14px;align-items:center;min-height:38px;}
    .radio-pill{display:flex;align-items:center;gap:7px;cursor:pointer;font-size:13.5px;font-weight:500;color:var(--text-primary);}
    .radio-pill input[type=radio]{width:17px;height:17px;accent-color:var(--primary);cursor:pointer;margin:0;}
    .modal-section-title{font-size:13px;font-weight:700;color:var(--text-primary);margin:18px 0 10px;padding-top:14px;border-top:1px solid var(--border);}
    .code-suggest{position:absolute;left:0;right:0;top:100%;z-index:50;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);max-height:260px;overflow-y:auto;}
    .code-suggest-row{display:flex;gap:10px;align-items:baseline;padding:8px 12px;cursor:pointer;font-size:12.5px;border-bottom:1px solid var(--border);}
    .code-suggest-row:last-child{border-bottom:none;}
    .code-suggest-row:hover{background:var(--bg-main);}
    /* Shown when nothing scores well enough. An honest miss beats a plausible wrong
       hit: the old matcher offered styrene to anyone searching for tyres. */
    .code-suggest-empty{padding:10px 12px;font-size:12.5px;color:var(--text-muted);line-height:1.5;}
    .code-suggest-row b{font-family:monospace;white-space:nowrap;color:var(--primary);}
    .code-suggest-row span{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    /* The choice panel is the one place truncation defeats the purpose: these rows differ
       only in a threshold at the END of the description, so "Vehicles; with only
       spark-ignition internal combustion piston engi…" hid the cylinder capacity the
       person is being asked to choose on. Wrap instead, and give the panel room. */
    .code-suggest-choice{max-height:340px;}
    .code-suggest-choice .code-suggest-row span{white-space:normal;line-height:1.45;}

    /* ── DOCKED CREATION PAGES (design review 17 Aug — Zoho parity) ──
       Record editors (invoice, quote, customer, item, ...) open beside the nav
       instead of on top of it: the overlay starts at the sidebar's right edge and
       below the top bar, so navigation and search stay visible and clickable —
       exactly how Zoho Books opens New Invoice / New Customer. Small utility
       dialogs (record payment, stock adjust, confirmations) stay centered.
       --topbar-h is measured by _setTopbarH() in main.js, since the top bar's
       height varies with breakpoint padding. */
    .modal-overlay.docked{left:var(--sidebar-width);top:var(--topbar-h,61px);background:var(--bg-main);backdrop-filter:none;padding:0;}
    .modal-overlay.docked .modal{width:100%;max-width:none !important;height:100%;max-height:none;border-radius:0;box-shadow:none;display:flex;flex-direction:column;overflow:hidden;}
    .modal-overlay.docked .modal-header{flex:0 0 auto;background:var(--bg-card);border-radius:0;padding:18px 32px;border-bottom:1px solid var(--border);}
    .modal-overlay.docked .modal-title{color:var(--text-primary);font-size:19px;}
    .modal-overlay.docked .modal-close{background:var(--bg-main);color:var(--text-secondary);}
    .modal-overlay.docked .modal-close:hover{background:var(--border);color:var(--text-primary);}
    .modal-overlay.docked .modal-body{flex:1 1 auto;overflow-y:auto;padding:26px 32px 40px;}
    /* Zoho leaves air on the right rather than stretching fields across the screen */
    .modal-overlay.docked .modal-body > *{max-width:960px;}
    .modal-overlay.docked .modal.modal-full .modal-body > *{max-width:1280px;}
    .modal-overlay.docked .modal-footer{flex:0 0 auto;border-radius:0;background:var(--bg-card);box-shadow:0 -1px 0 var(--border);}
    body.dark-mode .modal-overlay.docked .modal-header{background:var(--bg-card);}
    /* Phone: the sidebar is an off-canvas drawer, so the editor takes the full screen */
    @media (max-width:767px) {
      .modal-overlay.docked{left:0;top:0;}
    }

    /* ── LINE EDITORS ON A PHONE (24 Aug, Daniel: "Quantity is not working while trying
       to create a PO on the mobile") ──
       It was not the arithmetic. At 360px the PO's Qty input measured 27px wide and did
       not show its own value, and the order-lines table needed 343px inside a 296px
       wrapper. The invoice editor was worse: TEN columns needing 568px inside 290px.
       A number field 27px wide is below every touch-target guideline there is, and it is
       why a quantity could not be typed.

       Below 767px each line becomes a card instead: labels down the left, full-width
       controls on the right, nothing to scroll sideways. Desktop keeps its table exactly
       as it was — everything here is inside the media query.

       The labels come from :nth-child rather than a data-attribute so that not one of the
       five row-builders in main.js has to change. Column order is therefore load-bearing:
       if a column is added to one of these tables, add its label here too. */
    @media (max-width:767px) {
      .line-card-table{width:100%;}
      /* display:none, not the clip trick. Clipped, the <th> cells still laid themselves
         out and pushed the wrapper's scrollWidth 6px past its box, so the editor kept a
         phantom sideways scroll with nothing in it. The column names are not lost — every
         cell carries its own label below. */
      .line-card-table thead{display:none;}
      .line-card-table, .line-card-table tbody, .line-card-table tr, .line-card-table td{display:block;width:auto;}
      .line-card-table tr{position:relative;border:1px solid var(--border);border-radius:var(--radius-sm);
        padding:10px 12px 8px;margin:0 0 10px;background:var(--bg-card);}
      .line-card-table td{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;
        gap:10px;padding:5px 0;border:none;text-align:left !important;}
      .line-card-table td::before{content:attr(data-l);font-size:11px;font-weight:700;letter-spacing:.03em;
        text-transform:uppercase;color:var(--text-secondary);}
      /* Full-size controls. 40px clears the 44px target once padding is counted, and the
         inline width/text-align the row builders write have to be overridden. */
      .line-card-table td input, .line-card-table td select, .line-card-table td textarea{
        width:100% !important;min-height:40px;font-size:15px;text-align:left !important;padding:8px 10px !important;}
      /* 16px or larger stops iOS zooming the whole page when the field is focused.
         !important because the quote and PO row builders write an inline font-size. */
      .line-card-table td input[type="number"]{font-size:16px !important;}
      /* The remove button is the last cell and has no label — pin it to the card corner,
         and reserve the space so it does not sit on top of the first field. */
      .line-card-table tr td:first-child{padding-right:40px;}
      .line-card-table td:last-child{position:absolute;top:8px;right:6px;padding:0;display:block;}
      .line-card-table td:last-child::before{content:none;}
      .line-card-table td:last-child button{min-width:32px;min-height:32px;font-size:18px;line-height:1;
        border-radius:50%;background:var(--bg-main);}
      /* A read-only amount is a figure to read, not a field to fill. */
      .line-card-table td input[readonly]{border:none;background:transparent !important;padding-left:0 !important;
        font-weight:700;font-size:15px;}
      /* The wrapper exists to scroll a wide table. There is no wide table now. */
      .table-wrap:has(> .line-card-table){overflow:visible;border:none;}
    }

    /* Column labels per editor. Order matches the <thead> of each table above. */
    @media (max-width:767px) {
      /* Invoice — ten columns on desktop */
      .line-items-table td:nth-child(1)::before{content:"Item";}
      .line-items-table td:nth-child(2)::before{content:"Description";}
      .line-items-table td:nth-child(3)::before{content:"Qty";}
      .line-items-table td:nth-child(4)::before{content:"Unit";}
      .line-items-table td:nth-child(5)::before{content:"Unit price";}
      .line-items-table td:nth-child(6)::before{content:"VAT %";}
      .line-items-table td:nth-child(7)::before{content:"Discount %";}
      .line-items-table td:nth-child(8)::before{content:"WHT %";}
      .line-items-table td:nth-child(9)::before{content:"Amount";}
      /* Quote */
      .qt-items-table td:nth-child(1)::before{content:"Item";}
      .qt-items-table td:nth-child(2)::before{content:"Description";}
      .qt-items-table td:nth-child(3)::before{content:"Qty";}
      .qt-items-table td:nth-child(4)::before{content:"Unit";}
      .qt-items-table td:nth-child(5)::before{content:"Unit price";}
      .qt-items-table td:nth-child(6)::before{content:"VAT";}
      .qt-items-table td:nth-child(7)::before{content:"Discount %";}
      .qt-items-table td:nth-child(8)::before{content:"Amount";}
      /* Purchase order — the one Daniel could not use */
      .po-lines-table td:nth-child(1)::before{content:"Description";}
      .po-lines-table td:nth-child(2)::before{content:"Qty";}
      .po-lines-table td:nth-child(3)::before{content:"Unit cost";}
      .po-lines-table td:nth-child(4)::before{content:"Amount";}
      /* Credit note */
      .cn-line-items-table td:nth-child(1)::before{content:"Item";}
      .cn-line-items-table td:nth-child(2)::before{content:"Qty";}
      .cn-line-items-table td:nth-child(3)::before{content:"Unit price";}
      .cn-line-items-table td:nth-child(4)::before{content:"VAT %";}
      .cn-line-items-table td:nth-child(5)::before{content:"Amount";}
      /* Bill — stock received */
      .bill-stock-table td:nth-child(1)::before{content:"Item";}
      .bill-stock-table td:nth-child(2)::before{content:"Quantity";}
      .bill-stock-table td:nth-child(3)::before{content:"Unit cost";}
      .bill-stock-table td:nth-child(4)::before{content:"Line total";}
      /* Journal entry */
      .jr-lines-table td:nth-child(1)::before{content:"Account";}
      .jr-lines-table td:nth-child(2)::before{content:"Description";}
      .jr-lines-table td:nth-child(3)::before{content:"Debit";}
      .jr-lines-table td:nth-child(4)::before{content:"Credit";}
    }

    /* ── TOUCH TARGETS (mobile QA, 25 Aug) ──
       Measured across every money-flow editor at 360px and 414px. These were the controls
       left under a usable size once the line tables became cards. A finger pad is about
       9mm; 44px is the number Apple and Google both publish, and 29px is a miss waiting
       to happen — particularly the Goods/Service radios, which decide whether the line
       gets an HSN or an ISIC code. */
    @media (max-width:767px) {
      .modal-close{min-width:40px;min-height:40px;font-size:24px;line-height:1;}
      /* !important because several of these carry an inline width:16px;height:16px --
         #inv-bank-toggle among them, which stayed 16px tall until this overrode it. */
      .modal-body input[type="checkbox"], .modal-body input[type="radio"]{
        width:22px !important;height:22px !important;min-width:22px;flex:0 0 auto;}
      /* The label is the bigger target — make the whole thing tappable. */
      .modal-body label:has(> input[type="checkbox"]),
      .modal-body label:has(> input[type="radio"]){min-height:40px;display:flex;align-items:center;gap:8px;}
      .line-card-table td:last-child button{min-width:36px;min-height:36px;}
    }
