/* Spreadsheet-style grids (Home action list and Invoices): compact rows, gridlines, quick notes. */
.sheet-toolbar{background:#f4f8f9;border:1px solid #dce6e8;border-radius:8px;padding:10px 12px;gap:10px}
.sheet-toolbar p{flex:0 1 190px}.sheet-toolbar label{margin:0 0 3px;font-size:11px;letter-spacing:.3px;text-transform:uppercase;color:#56707b}
.sheet-toolbar input,.sheet-toolbar select{padding:6px 8px;font-size:13px}.sheet-toolbar button{padding:7px 14px;font-size:13px}
/* Filters that apply as soon as they change (auto-filter.js): the line saying so spans the whole row. */
.invoice-filters .filter-note{flex:1 1 100%;margin:0;font-size:12.5px;color:#56707b}
.invoice-filters .filter-note[hidden],.invoice-filters .apply-filters[hidden]{display:none}
.sheet-intro{margin:0 0 12px;font-size:13px}
.sheet-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:14px 0 8px;font-size:13px}
.invoice-grid.sheet table{min-width:880px;font-size:13px;line-height:1.35}
.sheet-panel,.panel:has(.sheet){padding:18px}
.sheet td,.sheet th{padding:6px 8px;vertical-align:middle}
.sheet thead th,.invoice-grid.sheet table.spreadsheet-table th{font-size:11px;white-space:normal;line-height:1.25}
.sheet tbody tr{scroll-margin-top:48px}
.sheet tbody tr:not(.priority-high):not(.customer-group):nth-child(even){background:#f8fbfc}
.sheet .customer-group th{padding:5px 8px;font-size:12px;letter-spacing:.3px}.spreadsheet-table .customer-group th{white-space:normal}
.sheet .nowrap,.sheet .money{white-space:nowrap}.sheet .num{text-align:right}
.sheet .pill{padding:2px 8px;font-size:11px;white-space:normal;display:inline-block;max-width:118px;line-height:1.3;border-radius:10px}
.age{display:inline-block;min-width:34px;text-align:center;border-radius:4px;padding:1px 6px;font-weight:600}
.age-0{color:#56707b}.age-1{background:#fff4d6;color:#7a5200}.age-2{background:#ffe3cc;color:#8a3b00}.age-3{background:#ffdcdf;color:#a31624}
.activity-cell{min-width:225px;max-width:340px}.activity-cell .quick-note{margin-top:5px}
.last-activity{display:grid;gap:1px}.last-meta{font-size:11px;color:#56707b;white-space:nowrap}.last-meta strong{color:#1f4450}
.last-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal}
.last-more{font-size:11px}.muted{color:#56707b;font-size:12px}
/* The Notes cell expands to every note and action on the invoice, newest first. */
.activity-history>summary{list-style:none;cursor:pointer;display:grid;gap:1px}
.activity-history>summary::-webkit-details-marker{display:none}
.activity-history .last-more{color:#007c76;font-weight:600;text-decoration:underline}
.activity-history .last-more::after{content:" ▾"}.activity-history[open] .last-more::after{content:" ▴"}
.activity-history[open]>summary .last-text,.activity-history[open]>summary .last-meta,.activity-history:not([open]) .when-open,.activity-history[open] .when-closed{display:none}
.history-list{list-style:none;margin:2px 0 4px;padding:0 0 0 8px;border-left:2px solid #dce6e8;display:grid;gap:6px;max-height:320px;overflow:auto}
.history-list li{display:grid;gap:1px}.history-text{white-space:normal;overflow-wrap:anywhere}.history-older{font-size:11px}
.note-cell{min-width:230px}.quick-note{display:flex;gap:4px}.quick-note input{padding:5px 7px;font-size:12.5px;min-width:0}.quick-note button{padding:5px 10px;font-size:12px}
.task-cell{min-width:140px;max-width:170px}.task-cell .pill{margin-left:2px}
.row-menu{position:relative}.row-menu summary{list-style:none;cursor:pointer;border:1px solid #c9dadd;border-radius:6px;padding:4px 9px;font-size:12px;font-weight:600;color:#1f4450;background:#fff;white-space:nowrap}
.row-menu summary::-webkit-details-marker{display:none}.row-menu summary::after{content:" ▾"}
.row-menu[open] summary{background:#e2fffe;border-color:#007c76}
.row-menu-list{position:fixed;display:grid;min-width:210px;background:#fff;border:1px solid #c9dadd;border-radius:8px;box-shadow:0 8px 24px rgba(16,40,50,.16);padding:6px;margin-top:4px;z-index:30}
.row-menu-list a{padding:7px 10px;border-radius:5px;text-decoration:none;color:#1f4450;white-space:nowrap}.row-menu-list a:hover,.row-menu-list a:focus{background:#e2fffe}
.row-menu-list.floating{margin:0;z-index:60;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.note-form{display:none}
tr:target td{background:#e8fbf4}
@media(max-width:700px){.sheet-toolbar p{flex:1 1 140px}}
.mailbox-test{margin:10px 0 14px;padding:12px 14px;border:1px solid #dce6e8;border-radius:8px;background:#f8fbfc;max-width:560px}
.mailbox-test-title{margin:0}.mailbox-test label{margin:6px 0 4px;font-size:13px}
.mailbox-test-row{display:flex;gap:8px}.mailbox-test-row input{flex:1;min-width:0}
.mailbox-test-result{display:block;max-width:560px;margin:0 0 8px;padding:8px 10px;border-radius:6px;font-size:13px}
.mailbox-test-result.ok{background:#e3f7ee;color:#135f3c}.mailbox-test-result.failed{background:#fff0ef;color:#9b2921}
/* Column filter menus (▾ beside each heading): a compact, Excel-style panel. */
.column-filter-panel{display:flex!important;flex-direction:column;gap:8px;width:260px!important;max-height:calc(100vh - 16px)!important;padding:10px!important;overflow:auto}
.column-filter-panel>*{flex-shrink:0}
.column-filter-panel button{background:#fff;color:#1f4450;border:1px solid #c9dadd;border-radius:6px;font-weight:500;text-align:left;min-height:0;padding:6px 9px;font-size:12.5px;line-height:1.3}
.column-filter-panel button:hover{background:#e2fffe;color:#1f4450;border-color:#007c76}
.column-filter-panel>label{margin:0;font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:#56707b;display:grid;gap:4px}
.column-filter-panel>label input{text-transform:none;font-weight:400;font-size:13px;letter-spacing:normal;padding:6px 8px;color:#1f4450}
.filter-sort{display:grid;gap:4px;padding-bottom:8px;border-bottom:1px solid #e3ecee}
.filter-picks,.filter-footer,.filter-width{display:flex;gap:6px}.filter-picks button,.filter-footer button,.filter-width button{flex:1;text-align:center}
.column-filter-panel .filter-choices{max-height:180px;overflow:auto;border:1px solid #e3ecee;border-radius:6px;padding:2px 4px}
.column-filter-panel .filter-choices label{margin:0;font-weight:400}
.filter-footer button:last-child{background:#007c76;color:#fff;border-color:#007c76}.filter-footer button:last-child:hover{background:#006963;color:#fff}
.column-filter-panel small{color:#56707b;font-size:11px}
.spreadsheet-table thead th.filter-open,.spreadsheet-table thead th:has(details[open]){z-index:60}
/* Payment plan tables: fit the page instead of the wide invoice-grid minimum. */
.invoice-grid.plans-grid table{min-width:0;font-size:13px}.plans-grid td,.plans-grid th{padding:8px 10px}
.plans-grid thead th{white-space:normal}
.remove-access{margin-top:6px;display:flex;gap:6px;align-items:center;flex-wrap:wrap}.remove-access label{margin:0;font-weight:400;font-size:12px;display:flex;gap:4px;align-items:center}.remove-access input[type=checkbox]{width:auto}
.small-link{font-size:13px;font-weight:600}
/* Reminder schedule builder */
.schedule-row{border-top:1px solid #e3ecee;padding:10px 0}.schedule-row:first-of-type{border-top:0}
.schedule-line{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.schedule-line select{width:auto;padding:7px 10px}
.schedule-line select[name$=_action]{min-width:200px}.schedule-when{font-weight:600;color:#1f4450}
.schedule-row.unused .schedule-when,.schedule-row.unused select[name$=_number],.schedule-row.unused select[name$=_unit]{opacity:.8}
.schedule-row:not(.is-email) .schedule-wording{display:none}.schedule-wording{margin-top:8px}.schedule-wording summary{cursor:pointer;color:#007c76;font-weight:600;font-size:13px}
.schedule-wording textarea{width:100%}.inline-check{display:flex;gap:8px;align-items:center;font-weight:600}.recommended-panel{border-color:#9cc7c4;background:#f3fbfa}.inline-check input{width:auto}
/* Disputes escalated to a manager stand out. */
.escalated-row td:first-child{box-shadow:inset 4px 0 0 #b7791f}
.escalated-flag{display:block;width:max-content;margin-top:4px;padding:2px 8px;border-radius:10px;background:#fff4d6;color:#7a5200;font-size:11px;font-weight:700}
/* Tick boxes on the record-an-action form sit beside their label, not stretched across the page. */
#id_invoice label{display:flex;align-items:flex-start;gap:10px;font-weight:500;margin:6px 0}
#id_invoice input,#id_escalate{width:auto;margin:3px 0 0}
label[for=id_escalate]{display:inline-block;margin-right:8px}
/* Set up a payment plan: instalment rows for custom dates and amounts. */
.plan-form fieldset{border:1px solid #dce6e8;border-radius:8px;padding:10px 14px;margin:16px 0}
.plan-form legend{font-weight:600;padding:0 4px}
.instalment-rows{display:grid;gap:8px}
.instalment-row{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end}
.instalment-row label{margin:0;font-size:13px}.instalment-row input{margin-top:3px}
.plan-form #id_schedule_type label,.plan-form #id_invoices label{display:flex;align-items:flex-start;gap:10px;font-weight:500;margin:6px 0}
.plan-form #id_schedule_type input{width:auto;margin:3px 0 0}
@media(max-width:520px){.instalment-row{grid-template-columns:1fr 1fr}.instalment-row .remove-instalment{grid-column:1/-1;justify-self:start}}
/* Home for managers, finance managers and clients: the report drop-down at the top. */
.report-picker{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.report-picker label{margin:0}
.report-picker select{width:auto;min-width:260px}.home-report-picker .export-controls{margin:10px 0 0}
/* Income Predictor: the dates and downloads as one small toolbar at the top, like a spreadsheet. */
.cashflow-toolbar{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;background:#f4f8f9;border:1px solid #dce6e8;border-radius:8px;padding:8px 12px;margin:0 0 14px;font-size:13px}
.cashflow-toolbar label{display:flex;align-items:center;gap:6px;margin:0;font-weight:600;font-size:12px;color:#56707b}
.cashflow-toolbar input,.cashflow-toolbar select{width:auto;padding:5px 7px;font-size:13px}
.cashflow-toolbar .toolbar-downloads{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-left:auto;font-size:12px;color:#56707b}
.cashflow-toolbar .toolbar-downloads .subtext{display:inline;margin:0 0 0 6px}
/* Income Predictor: what each column means, and every figure opens to list the invoices behind it. */
.cashflow-key{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 18px;margin:0 0 8px}
.cashflow-key div{border-left:3px solid #dce6e8;padding-left:9px}.cashflow-key dt{font-weight:700;font-size:13px;color:#1f4450}
.cashflow-key dd{margin:2px 0 0;font-size:12.5px;color:#56707b}
.cashflow-table td.num,.cashflow-table th{text-align:right}.cashflow-table th:nth-child(-n+2),.cashflow-table td:nth-child(-n+2){text-align:left}
.cashflow-table th.text,.cashflow-table td.text{text-align:left}
.cashflow-table .cash-in summary,.cashflow-table .cash-in .figure-zero{font-weight:700;color:#1f4450}
.figure summary{cursor:pointer;color:#007c76;font-weight:600;text-decoration:underline dotted;list-style:none}
.figure summary::-webkit-details-marker{display:none}
.figure-at_risk summary{color:#a31624}
.figure-zero{color:#8aa0a8}
.figure-items{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:6px;min-width:250px;text-align:left;font-size:12.5px}
.figure-why{display:block;color:#56707b}.figure-at_risk .figure-why{color:#a31624}
/* Home and Invoices: the risk level under an invoice's stage. */
.risk-pill{display:inline-block;margin-top:4px;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:700}
.risk-at_risk{background:#ffdcdf;color:#a31624}.risk-watch{background:#fff4d6;color:#7a5200}
.risk-reasons{display:block;font-size:11px;color:#56707b;max-width:220px}
.risk-rules td{vertical-align:top}.risk-rules input[type=checkbox]{width:auto}.risk-rules label{margin:0}
.risk-threshold{display:flex;align-items:center;gap:6px;font-weight:400;font-size:12.5px;margin:0 0 4px}
.risk-threshold input{width:80px;padding:5px 7px}.risk-rules select{width:auto;padding:5px 7px}
/* The error pop-up (error-reporter.js and the error page). */
.error-dialog{max-width:460px;width:calc(100% - 32px);border:1px solid #dce6e8;border-radius:12px;padding:20px 22px;box-shadow:0 18px 50px rgba(16,40,50,.25);color:#1f4450}
.error-dialog::backdrop{background:rgba(16,40,50,.35)}
.error-dialog h2{margin:0 0 8px;font-size:19px}.error-dialog textarea{width:100%}
.error-dialog-buttons{display:flex;gap:10px;align-items:center;margin:12px 0 0}

/* Page layout on wide screens: boxes without tables sit two to a row (layout.js pairs them as .box-pair);
   tables, lists, banners and long forms keep the full width. Phones and narrow windows are unchanged. */
@media (min-width:1180px){
.app-main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px;align-content:start}
.app-main>*{grid-column:1/-1;min-width:0}
.app-main>.panel{margin:0 0 22px}
.app-main>.box-pair{grid-column:auto;align-self:start}
.app-main>.panel.narrow{max-width:none;margin:0 0 22px}
.app-main>.panel.narrow:not(.box-pair){justify-self:center;width:100%;max-width:760px}
}
/* Build a report: the steps on the left, the report on the right, like building a report in a spreadsheet */
.builder{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:28px;align-items:start}.builder-steps{margin:0}
.builder-step{border:1px solid #dce6e8;border-radius:8px;margin:0 0 14px;padding:10px 14px 14px;min-width:0}.builder-step legend{font-weight:600;padding:0 6px;color:var(--heading)}
.step-number{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#007c76;color:#fff;font-size:12px;margin-right:4px}
.builder-step label{margin:10px 0 4px;font-size:13px}.builder-step select,.builder-step input:not([type=checkbox]){width:100%}
.builder-checks{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:0 10px;max-height:280px;overflow:auto}
.builder-checks label{display:flex;align-items:center;gap:8px;font-weight:400;margin:4px 0;cursor:pointer}.builder-checks input[type=checkbox]{width:18px;height:18px;margin:0;flex-shrink:0}
.builder-label{font-weight:600;font-size:13px;margin:12px 0 4px}.builder-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.builder-pair>div{min-width:0}.builder-pair.builder-dates{grid-template-columns:1fr;gap:0}
.builder-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:12px 0 0}.builder-preview{min-width:0}.builder-preview h2{margin-bottom:4px}
.builder-total td,.builder-total th{font-weight:700;border-top:2px solid #c9d6dc;background:#f8fafc}
.builder-save{border-top:1px solid #e7ecf2;margin-top:22px;max-width:520px}.builder-save h3{margin:16px 0 0;font-size:16px}
.builder-save .inline-check{display:flex;gap:8px;align-items:center;font-weight:400}.builder-save .inline-check input{width:auto}
.builder-delete summary{font-size:12px;color:#9b2921}.builder-delete form{margin-top:6px}
@media(max-width:980px){.builder{grid-template-columns:1fr}}
/* The email signature box uses the panel's width, so addresses and email addresses fit on one line */
#email-signature textarea{display:block;width:100%;max-width:720px;min-height:170px;line-height:1.5}
/* Set up a payment plan: what each payment comes to, as soon as the total and number are entered */
.instalment-preview{margin:12px 0 0;padding:10px 12px;border-radius:8px;background:#eef6f5;color:#1f4450}.instalment-preview:empty{display:none}
/* Clarity admin, Account management: one compact row per account that opens to Users, Access,
   Subscription and Data & account. Changes that remove access or data sit apart, in red. */
.admin-nav{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 8px}.app-main .admin-nav a{display:inline-flex;align-items:center;min-height:44px;padding:8px 18px;margin:0;border:1px solid #c5d6dc;border-radius:999px;background:#fff;color:var(--primary);font-size:15px;font-weight:600;text-decoration:none}.app-main .admin-nav a:hover,.app-main .admin-nav a:focus-visible{border-color:var(--primary)}.app-main .admin-nav a[aria-current="page"]{background:var(--primary);border-color:var(--primary);color:#fff}
.account-filter-bar{display:grid;grid-template-columns:minmax(200px,2fr) repeat(5,minmax(110px,1fr));gap:10px;align-items:end}.account-filter-bar label{margin:0 0 4px;font-size:12px}.account-filter-bar select,.account-filter-bar input{width:100%}
.account-filter-actions{grid-column:1/-1;display:flex;gap:14px;align-items:center;white-space:nowrap}.account-quick{margin:12px 0 0;font-size:13px}
.account-list{border:1px solid #e0e6ee;border-radius:8px;overflow:hidden}
.account-head,.account-row>summary{display:grid;grid-template-columns:minmax(160px,1.6fr) minmax(110px,1fr) minmax(130px,1.2fr) minmax(100px,.9fr) minmax(110px,1fr) 92px 64px;gap:12px;align-items:center;padding:10px 14px}
/* The counts along the top: each one opens its own list. */
.account-counts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:0 0 16px}.app-main .account-count{display:block;padding:12px 14px;border:1px solid #d6e3e6;border-radius:8px;background:#fff;color:var(--text);text-decoration:none}.app-main .account-count:hover{border-color:var(--primary)}.account-count[aria-current]{border-color:var(--primary);background:#eef6f5;box-shadow:inset 0 0 0 1px var(--primary)}.account-count strong{display:block;font-family:Outfit,sans-serif;font-size:24px;line-height:1.2;color:var(--heading)}.account-count span{font-size:13px;font-weight:600}
.count-cancelling strong{color:#8a5300}.count-overdue strong{color:#9b2921}.count-ended strong{color:#4b5b6b}
.account-showing{margin:0 0 12px;font-size:14px}.account-showing .subtext{margin-top:4px}
/* Each cell's name is read out on a computer and shown on a phone, where the columns stack. */
.ac-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.account-summary{display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;padding:0;list-style:none}.account-summary .subtext{margin:0 0 3px}
.account-cancellation{margin-top:10px;padding:10px 12px;border-left:4px solid #d39a2c;background:#fffaf0;border-radius:4px}.account-cancellation p{margin:0 0 6px}
.account-facts-list{display:grid;grid-template-columns:max-content 1fr;gap:4px 12px;margin:0;font-size:13px}.account-facts-list dt{font-weight:600}.account-facts-list dd{margin:0;overflow-wrap:anywhere}
.account-head{background:#f8fafc;font-size:10px;letter-spacing:.6px;text-transform:uppercase;color:#687a90;font-weight:700}
.account-row{border-top:1px solid #e7ecf2}.account-row>summary{cursor:pointer;list-style:none;font-size:13px}.account-row>summary::-webkit-details-marker{display:none}
.account-row>summary:hover{background:#f6faf9}.account-row[open]>summary{background:#eef6f5}.account-row>summary>span{min-width:0;overflow-wrap:anywhere}
.ac-open{color:#007c76;font-weight:600;font-size:12px;text-align:right}.ac-open::after{content:" ▾"}.account-row[open] .ac-open::after{content:" ▴"}
.account-detail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:16px 14px 20px;background:#fbfdfd;border-top:1px solid #e7ecf2}
.account-section.account-users,.account-section.account-data{grid-column:1/-1}.account-section{background:#fff;border:1px solid #e0e6ee;border-radius:8px;padding:12px 14px;min-width:0}.account-section h3{margin:0 0 8px;font-size:15px}
.account-section table td,.account-section table th{padding:8px}.account-facts{margin:0;padding-left:18px}.account-facts li{margin:4px 0}
.account-form label{margin:10px 0 4px;font-size:13px}.account-form select,.account-form textarea,.account-form input:not([type=checkbox]){width:100%}.account-form button{margin-top:10px}
.account-form .inline-check{display:flex;gap:8px;align-items:flex-start;font-weight:400}.account-form .inline-check input{width:auto;margin-top:3px}
.danger-zone{border:1px solid #f0c5c1;background:#fff8f7;border-radius:8px;padding:10px 12px;margin-top:12px}.danger-title{margin:0 0 6px;font-weight:700;color:#9b2921;font-size:13px}
.danger-zone details{margin:6px 0}.danger-zone summary{color:#9b2921;font-weight:600}.danger-button{background:#b42318}.danger-button:hover{background:#912018}
.pill.acct-software_monthly,.pill.acct-software_annual,.pill.sub-active,.pill.state-active{background:#e3f4ee;color:#11633f}
.pill.acct-managed,.pill.acct-internal,.pill.acct-complimentary,.pill.acct-trial,.pill.acct-owner{background:#e8eefb;color:#2b4a8b}
.pill.acct-suspended,.pill.sub-past_due,.pill.sub-pending,.pill.state-suspended,.pill.state-deletion_requested{background:#fff4d6;color:#7a5200}
.pill.acct-none,.pill.state-no_access,.pill.state-deletion_scheduled{background:#fdecea;color:#9b2921}
.pill.acct-cancelled,.pill.sub-cancelled,.pill.sub-none,.pill.state-cancelled,.pill.state-deleted{background:#eef1f4;color:#4b5b6b}
.pill.cancelling,.pill.sub-cancelling{background:#fff1d6;color:#7a4b00;font-weight:600}.pill.overdue{background:#fdecea;color:#9b2921;font-weight:600}
.account-section.account-overview{grid-column:1/-1}.ac-status .pill{white-space:nowrap}
.account-row .subtext{margin-top:2px}.account-pages{margin:14px 0 0}
@media(max-width:1100px){.account-filter-bar{grid-template-columns:repeat(3,minmax(0,1fr))}.account-search{grid-column:1/-1}.account-detail{grid-template-columns:1fr}}
@media(max-width:900px){.account-head{display:none}.account-row>summary{grid-template-columns:1fr 1fr;gap:6px 12px}.ac-business{grid-column:1/-1}.ac-open{text-align:left}}
@media(max-width:600px){.account-filter-bar{grid-template-columns:1fr}}
/* A closed column menu takes no space, and things inside a scrolling table stay inside it, so pages never scroll sideways on a phone. */
.column-filter:not([open])>.column-filter-panel{display:none!important}
.table-scroll{position:relative}
.field-grid>*,fieldset{min-width:0}
.auth-main>*{min-width:0;max-width:100%}
.builder-total th{text-transform:none;letter-spacing:0;font-size:13px;color:var(--heading)}
@media(max-width:1100px){.account-head{display:none}.account-row>summary{grid-template-columns:1fr 1fr;gap:8px 12px}.ac-business{grid-column:1/-1}.ac-open{text-align:left}.ac-label{position:static;width:auto;height:auto;overflow:visible;clip:auto;display:block;font-size:11px;font-weight:600;color:#56707b}.account-counts{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.account-counts{grid-template-columns:repeat(2,minmax(0,1fr))}.account-count strong{font-size:20px}.account-facts-list{grid-template-columns:1fr}.account-facts-list dd{margin-bottom:4px}}
@media(min-width:1101px){.account-head,.account-row>summary{grid-template-columns:minmax(0,1.6fr) minmax(min-content,1fr) minmax(min-content,1.2fr) minmax(min-content,.9fr) minmax(min-content,1fr) 92px 64px}.account-row>summary>span:not(.ac-business){overflow-wrap:normal}}
.suitable-use{margin:12px 0 24px;border-left:4px solid var(--primary)}.suitable-use h2{margin:4px 0 8px}.suitable-use p:last-child{margin-bottom:0}
/* Customise Home (home_customise.html): a button at the top right of the Home heading; the choices open below the heading. */
.home-heading{position:relative;padding-right:200px}
.home-customise>summary{position:absolute;top:0;right:0;list-style:none;display:inline-flex;align-items:center;min-height:40px;box-sizing:border-box;padding:8px 14px;border:1px solid #9cc7c4;border-radius:6px;background:#fff;color:#007c76;font-weight:600;font-size:14px;white-space:nowrap}
.home-customise>summary::-webkit-details-marker{display:none}
.home-customise>summary::after{content:"\00a0\25be"}
.home-customise[open]>summary::after{content:"\00a0\25b4"}
.home-customise>summary:hover,.home-customise[open]>summary{background:#e2fffe;border-color:#007c76}
.home-heading .home-customise-form{margin-top:18px;max-width:720px;background:#fff;border:1px solid #dce6e8;border-radius:8px;padding:14px 18px}
.home-heading .home-customise-form p{margin:4px 0 8px}
.home-customise-form fieldset{border:0;padding:0;margin:12px 0 0}
.home-customise-form legend{font-weight:600;padding:0;margin-bottom:2px}
.home-customise-form label.choice{display:flex;align-items:center;gap:10px;font-weight:400;margin:8px 0}
.home-customise-form label.choice input{width:20px;height:20px;margin:0;flex-shrink:0}
.home-customise-form select{max-width:360px}
.home-customise-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 8px}
@media (max-width:760px){.home-heading{padding-right:0}.home-customise>summary{position:static;margin-top:14px}.home-heading .home-customise-form{padding:12px}}
/* Form problems: Django's error lists (beside a box or at the top of a form) stand out in red. */
ul.errorlist{list-style:none;margin:6px 0 10px;padding:8px 12px;background:#fff0ef;color:#9b2921;border-left:4px solid #9b2921;border-radius:6px;font-weight:600;font-size:14px}
ul.errorlist li{margin:0}
.form-problems{margin:0 0 20px;border-left:5px solid #9b2921}
.form-problems ul{margin:8px 0 0;padding-left:20px}
.form-problems a{color:#9b2921}
/* CASA Readiness (templates/compliance/casa*.html): gate, status pills, checklist items and flows. */
.casa-disclaimer{background:#fff8e6;border-left:5px solid #b66d00;border-radius:6px;padding:10px 14px;margin:6px 0 16px}
.casa-gate{border-left:6px solid #9b2921}
.casa-gate-ready{border-left-color:#1f7a4d}
.casa-verdict{display:inline-block;margin-left:8px;padding:3px 12px;border-radius:20px;font-size:15px;background:#9b2921;color:#fff;vertical-align:middle}
.casa-gate-ready .casa-verdict{background:#1f7a4d}
.casa-blockers{border-top:1px solid #e0e6ee;padding:6px 0}
.casa-blockers>summary{cursor:pointer;font-weight:600}
.casa-blockers ul{margin:6px 0 6px 18px;padding:0}
.casa-blockers li{margin:4px 0;overflow-wrap:anywhere}
.casa-accepted{opacity:.75}
.casa-code{font-size:11px;background:#f1f4f8;border-radius:4px;padding:1px 5px;color:#365879;overflow-wrap:anywhere}
.casa-counts{list-style:none;padding:0;margin:8px 0;display:grid;gap:4px}
.pill.casa-status-verified{background:#dff3e8;color:#1f6b45}
.pill.casa-status-ready{background:#e2f6f4;color:#246c69}
.pill.casa-status-in-progress{background:#fff1d6;color:#7a5200}
.pill.casa-status-not-started{background:#fde8e6;color:#9b2921}
.pill.casa-status-not-applicable{background:#eef1f4;color:#4f5b66}
.pill.casa-proposed{background:#eef4fa;color:#365879}
.pill.casa-critical{background:#9b2921;color:#fff}
.pill.casa-missing{background:#fde8e6;color:#9b2921}
.casa-links{margin:0 0 18px;font-size:14px}
.casa-filter p{margin:0}
.casa-item{border:1px solid #e0e6ee;border-radius:8px;margin:8px 0;background:#fff}
.casa-item>summary{cursor:pointer;padding:10px 12px;list-style:none;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.casa-item>summary::-webkit-details-marker{display:none}
.casa-item[open]>summary{border-bottom:1px solid #e0e6ee;background:#f8fafc}
.casa-item.casa-overdue{border-left:5px solid #b66d00}
.casa-item-ref{font-weight:700;color:#365879}
.casa-item-title{font-weight:600;flex:1 1 260px}
.casa-item-body{padding:4px 14px 12px}
.casa-item-body h3{font-size:14px;margin:12px 0 4px}
.casa-stages{list-style:none;padding:0;margin:10px 0;display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:6px}
.casa-stages li{border-radius:6px;padding:6px 8px;font-size:13px;display:flex;flex-direction:column;gap:2px}
.casa-stage-done{background:#dff3e8}
.casa-stage-todo{background:#fdf0ee}
.casa-links-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:4px 18px}
.casa-links-grid p{margin:3px 0;font-size:13px;overflow-wrap:anywhere}
.casa-columns{columns:2 220px;margin:0}
.casa-flow{list-style:none;counter-reset:flow;padding:0;margin:10px 0;display:flex;flex-wrap:wrap;gap:8px 30px}
.casa-flow li{counter-increment:flow;position:relative;background:#eef4fa;border:1px solid #c9d8e8;border-radius:8px;padding:8px 10px 8px 34px;max-width:240px;font-size:13px}
.casa-flow li::before{content:counter(flow);position:absolute;left:8px;top:8px;width:18px;height:18px;border-radius:50%;background:#365879;color:#fff;font-size:11px;line-height:18px;text-align:center}
.casa-flow li:not(:last-child)::after{content:"\2192";position:absolute;right:-22px;top:50%;transform:translateY(-50%);color:#365879;font-weight:700}
@media (max-width:760px){.casa-flow{flex-direction:column;gap:22px}.casa-flow li{max-width:none}.casa-flow li:not(:last-child)::after{content:"\2193";right:auto;left:50%;top:auto;bottom:-20px;transform:none}}
.casa-filter p{max-width:100%}.casa-filter select,.casa-filter input{max-width:100%}
.compliance-cards code,.casa-item code,.casa-links-grid code{overflow-wrap:anywhere;word-break:break-all}
/* Email templates: one block per email, subject and message full width. */
.template-email{border-top:1px solid #e3ecee;padding:12px 0}.template-email:first-of-type{border-top:0}.template-email h3{margin:0 0 6px;font-size:16px}.template-email input[type=text],.template-email textarea{width:100%;max-width:none;box-sizing:border-box}.template-email textarea{min-height:190px}.template-picker{margin:0 0 16px}
/* Account, Subscription and entities: each business, with Archive; archived businesses with Reactivate. */
.entity-list{list-style:none;margin:0;padding:0}.entity-list>li{padding:8px 0;border-top:1px solid #e7ecf2}.entity-list>li:first-child{border-top:0}.entity-list .subtext{display:block}.entity-archive{margin-top:6px}.entity-archive summary{color:#9b2921;font-weight:600;cursor:pointer}.entity-archive textarea{width:100%}
.entity-rename{margin-top:6px}.entity-rename summary{cursor:pointer;font-weight:600}.entity-rename input{width:100%;max-width:420px}
/* Settings and the setup wizard: Sender name. Each choice shows the From line it gives. */
.sender-choices{border:0;margin:0 0 12px;padding:0}.sender-choices legend{font-weight:600;margin-bottom:6px}.sender-choices .subtext{display:block;overflow-wrap:anywhere}.sender-choices input[type=text],.sender-choices input:not([type]){width:100%;max-width:520px}.sender-from{overflow-wrap:anywhere}
/* Ask a manager to decide: statuses, and the line on an invoice or customer. */
.pill.escalation-open{background:#fff1d6;color:#7a4b00;font-weight:600}.pill.escalation-approved{background:#e3f4ea;color:#1d6b3a}.pill.escalation-rejected{background:#fdecea;color:#9b2921}.pill.escalation-returned{background:#e8f0fb;color:#24508f}.pill.escalation-taken_over{background:#efe9fb;color:#4f2f8f}.pill.escalation-withdrawn{background:#eef1f4;color:#4b5b6b}.escalation-status{margin:10px 0;padding:10px 12px;border-left:4px solid #d39a2c;background:#fffaf0;border-radius:4px}.escalation-form textarea,.escalation-form input:not([type=date]),.escalation-form select{width:100%;max-width:640px}
/* Needs your decision: one card per request; works on a phone. */
.escalation-filters{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:end}.escalation-filters label{display:flex;flex-direction:column;font-size:13px;gap:4px}.escalation-filters .inline-check{flex-direction:row}.escalation-head{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}.escalation-head h2{margin:0}.escalation-card.late{border-left:4px solid #9b2921}.escalation-facts{display:grid;grid-template-columns:max-content 1fr;gap:6px 14px;margin:10px 0}.escalation-facts dt{font-weight:600}.escalation-facts dd{margin:0;overflow-wrap:anywhere}.escalation-decision fieldset{border:0;padding:0;margin:0 0 8px;display:flex;flex-wrap:wrap;gap:6px 18px}.escalation-decision textarea{width:100%;max-width:640px}
@media(max-width:600px){.escalation-facts{grid-template-columns:1fr}.escalation-facts dd{margin-bottom:6px}}
/* Which client a settings page is for, with a box to switch client. */
.client-switch{display:flex;flex-wrap:wrap;gap:6px 18px;align-items:center;margin:6px 0 14px;padding:8px 12px;border-left:4px solid var(--primary);background:#eef6f5;border-radius:4px}.client-switch p{margin:0}.client-switch-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0}.client-switch-form label{margin:0;font-weight:600}.client-settings-links ul{margin:0;padding-left:20px}.client-settings-links li{margin:4px 0}
/* Settings, Email signature: paste a signature with its pictures, and see it as customers will. */
.signature-paste-panel{margin-top:18px;padding-top:12px;border-top:1px solid #e0e6ee}.signature-paste{min-height:110px;max-height:420px;overflow:auto;padding:10px 12px;border:1px solid #b9c7d3;border-radius:6px;background:#fff}.signature-paste:focus{outline:2px solid var(--primary);outline-offset:1px}.signature-paste img{max-width:100%;height:auto}.signature-preview{width:100%;min-height:200px;border:1px solid #e0e6ee;border-radius:6px;background:#fff}
/* Click-to-open sections: Settings (made by sheet.js) and the customer form (details elements). */
.settings-panels{display:grid;gap:14px}.panel.collapsible{padding-top:0;padding-bottom:0}.panel.collapsible>h2{margin:0}.panel-toggle{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;padding:18px 0;background:transparent;color:var(--heading);font:inherit;font-weight:inherit;text-align:left;border-radius:0}.panel-toggle:hover{background:transparent;color:var(--primary)}.panel-toggle::after{content:'';flex:none;width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-right:4px;transition:transform .15s}.panel.collapsible:not(.collapsed)>h2 .panel-toggle::after{transform:rotate(-135deg)}.panel.collapsible:not(.collapsed){padding-bottom:22px}.panel.collapsed>:not(h2){display:none}.form-section{border:1px solid #e0e6ee;border-radius:8px;margin:0 0 12px;background:#fff}.form-section>summary{cursor:pointer;padding:14px 16px;font-family:Outfit,'Helvetica Neue',sans-serif;font-size:18px;font-weight:600;color:var(--heading)}.form-section[open]>summary{border-bottom:1px solid #e7ecf2}.form-section>fieldset{border:0;margin:0;padding:6px 16px 16px}
.form-section>summary{list-style:none;display:flex;align-items:center;justify-content:space-between}.form-section>summary::-webkit-details-marker{display:none}.form-section>summary::after{content:'';flex:none;width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-right:4px;transition:transform .15s}.form-section[open]>summary::after{transform:rotate(-135deg)}

/* The one email signature box (Settings and the setup wizard): shows the signature as customers see it. */
.signature-box{display:block;width:100%;min-height:240px;border:1px solid #b9c7d3;border-radius:6px;background:#fff;resize:vertical}.signature-box:focus-within{outline:2px solid var(--primary);outline-offset:1px}.signature-box-wrap{margin:8px 0}

/* Reminder schedule: unused rows are hidden when the page script runs; Add a reminder and Remove. */
.js .schedule-steps .schedule-row.unused{display:none}.step-remove{margin-left:auto;font-size:13px}.schedule-line{flex-wrap:wrap}.step-add{margin:10px 0 0}.step-add .subtext{margin-left:8px}
/* The business you are working in: easy to spot at the top of every page that has the box. */
.topbar form:has(#entity){background:#eef6f5;border:1px solid #9fd2cc;border-left:4px solid var(--primary);border-radius:8px;padding:6px 8px 6px 12px;gap:10px}.topbar form:has(#entity) label{font-size:11px;letter-spacing:.8px;text-transform:uppercase;color:#2f5f5b;font-weight:700}.topbar #entity{font-weight:700;font-size:15px;color:var(--heading);min-width:220px;border-color:#7fbfb8;background:#fff}
/* Next actions: the Done button sits beside the action, on Home. */
.next-action-done{display:inline;margin:0 0 0 6px}.next-action-done button{padding:2px 10px;min-height:0}
/* Contact details on the invoice page: label and value side by side, stacking on a phone. */
.contact-list{display:grid;grid-template-columns:max-content 1fr;gap:6px 16px;margin:8px 0}.contact-list dt{font-weight:700;color:#2f5f5b}.contact-list dd{margin:0;overflow-wrap:anywhere}.contact-people{margin:4px 0 0;padding-left:18px}@media(max-width:600px){.contact-list{grid-template-columns:1fr}.contact-list dd{margin-bottom:6px}}
/* Contacts on the customer page: a tick per email for invoices and reminders. */
.contacts-table td{vertical-align:top}.contacts-table .tick{display:inline-flex;min-width:44px;min-height:32px;align-items:center;justify-content:center}.contacts-table input[type=checkbox]{width:20px;height:20px}.contact-remove{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
/* Unpaid invoices with nothing planned: a warning panel on Home and the account overview. */
.needs-action{border-left:4px solid #b66d00;background:#fff8ec}.needs-action .eyebrow{color:#8a5200}
/* Invite form: what each kind of access means, under the drop-down list. */
.access-meanings{display:grid;grid-template-columns:max-content 1fr;gap:4px 14px;margin:0 0 14px;font-size:13px}.access-meanings dt{font-weight:700}.access-meanings dd{margin:0;color:#3f5a60}@media(max-width:600px){.access-meanings{grid-template-columns:1fr}.access-meanings dd{margin-bottom:6px}}
/* The invoice page: details at the top. */
.invoice-details .overdue-pill{background:#fde8e6;color:#8f2418;border-color:#f3b8b0}
/* Link lists on a page, not the dark sidebar: the general "nav a" style is pale text meant for navy. */
.business-links a,.pager a{display:inline;padding:0;margin:0;color:var(--primary);text-decoration:underline}
[data-step-full][hidden]{display:none}
.row-buttons{display:flex;gap:6px;align-items:flex-start}
.record-now summary{background:#007c76;border-color:#007c76;color:#fff}.record-now[open] summary{background:#006963;color:#fff}
.record-now-list{min-width:300px;max-width:360px;padding:12px}.record-now-form{display:grid;gap:6px;margin:0}.record-now-form fieldset{border:0;margin:0;padding:0;display:grid;gap:4px}.record-now-form legend{font-weight:700;font-size:12px;color:#1f4450;margin-bottom:2px}.record-now-form label{font-size:13px;margin:0}.record-now-form textarea,.record-now-form input:not([type=radio]):not([type=checkbox]),.record-now-form select{width:100%;box-sizing:border-box}.record-now-form [hidden]{display:none}.record-now-list .next-action-done{display:block;margin:8px 0 0}.record-now-form fieldset.record-kinds{grid-template-columns:1fr 1fr;column-gap:10px}.record-now-form .record-next{grid-template-columns:1fr 1fr;column-gap:6px}.record-now-form .record-next legend,.record-now-form .record-next input[name=next_action_note]{grid-column:1/-1}
.customer-group-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;text-transform:none;letter-spacing:normal}.customer-group-heading .subtext{font-weight:400;margin-left:8px}.customer-group-heading summary{font-size:12px}
.record-now-form .record-invoices{max-height:140px;overflow:auto;border:1px solid #e1ebed;border-radius:6px;padding:6px}
tr.client-hidden{display:none}.client-filter{display:flex;align-items:center;gap:8px;margin:8px 0 4px}.client-filter label{margin:0;font-weight:600}
.business-picker{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0 0}.business-picker label{margin:0;font-weight:600}.business-picker select{max-width:100%;min-width:240px}
.record-now-form input[type=radio],.record-now-form input[type=checkbox]{width:auto;margin:0;padding:0;flex:none}.record-now-form label:has(>input[type=radio]),.record-now-form label:has(>input[type=checkbox]){display:flex;align-items:center;gap:6px;font-weight:400;cursor:pointer}
.contact-pop{display:none;position:fixed;z-index:70;min-width:220px;max-width:320px;background:#fff;border:1px solid #c9dadd;border-radius:8px;box-shadow:0 8px 24px rgba(16,40,50,.16);padding:10px 12px;font-size:13px;font-weight:400;color:#1f4450;text-transform:none;letter-spacing:normal;white-space:normal;text-align:left}.contact-pop>span{display:block;margin-top:4px}.contact-hover:hover .contact-pop,.contact-hover:focus-within .contact-pop{display:block}
.collapsible>summary{display:flex;justify-content:space-between;align-items:center;gap:1rem;cursor:pointer;list-style:none}.collapsible>summary::-webkit-details-marker{display:none}.collapse-toggle{font-weight:600;white-space:nowrap;color:#8a5200}.collapsible[open] .when-closed,.collapsible:not([open]) .when-open{display:none}
.invite-steps li,.invite-checks li{margin-bottom:.5rem}.invite-status{border-left:4px solid #8a5200;padding:.25rem .75rem;margin:.75rem 0}
.signature-preview{margin:6px 0 12px}.signature-preview-box{min-height:160px;resize:vertical}.signature-preview-text{white-space:pre-wrap;font:inherit;background:#fff;border:1px solid #b9c7d3;border-radius:6px;padding:10px;margin:4px 0}
