/* Isolated content styles: the existing navigation and overall design remain intact. */
.setup-layout4000{display:grid;grid-template-columns:minmax(190px,230px) minmax(0,1fr);gap:24px;align-items:start}
.setup-steps4000{display:grid;gap:6px;position:sticky;top:92px}.setup-steps4000 a{display:flex;gap:10px;align-items:center;padding:12px;border-radius:8px;color:var(--brand-text);text-decoration:none}.setup-steps4000 a[aria-current]{background:var(--brand-active);font-weight:700}.setup-steps4000 span{display:grid;place-items:center;border:1px solid var(--brand-border);min-width:28px;height:28px;border-radius:50%}
.setup-content4000{min-width:0}.setup-content4000 h2{margin-top:0}.platform-fields4000{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:24px}.platform-field4000{display:flex;flex-direction:column;gap:8px;min-width:0}.platform-field4000 input:not([type=checkbox]),.platform-field4000 select,.platform-field4000 textarea{box-sizing:border-box;width:100%;max-width:100%}.platform-field4000 small{color:var(--brand-text-muted);overflow-wrap:anywhere;line-height:1.5}.platform-field4000.checkbox4000{display:flex;flex-direction:row-reverse;justify-content:flex-end;align-items:center}.platform-field4000 input[type=checkbox]{flex:none}.platform-field4000 .errorlist{margin:0;padding-left:20px}
.actions4000{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.actions4000 form{margin:0}.actions4000 label{display:flex;align-items:center;gap:8px;margin:0}.setup-footer4000{margin-top:28px;border-top:1px solid var(--brand-border);padding-top:20px}.notice4000{padding:16px;border:1px solid var(--brand-border);border-radius:8px;background:var(--brand-active);line-height:1.6}.setup-item4000{display:flex;flex-direction:column;gap:8px;padding:18px 0;border-bottom:1px solid var(--brand-border)}
.installation-grid4000{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.status-list4000 div{display:grid;grid-template-columns:minmax(130px,1fr) minmax(0,1.6fr);gap:16px;padding:14px 0;border-bottom:1px solid var(--brand-border)}.status-list4000 dt{color:var(--brand-text-muted)}.status-list4000 dd{margin:0;overflow-wrap:anywhere}.status-list4000 code{white-space:normal;word-break:break-all}
.brand-preview4000{border:2px solid var(--brand-primary);border-radius:10px;padding:20px;margin:16px 0}.brand-preview4000 strong{font-size:1.5rem}.comparison-wrap4000{max-height:70vh;overflow:auto;border:1px solid var(--brand-border);border-radius:8px}.comparison4000{border-collapse:separate!important;border-spacing:0;min-width:100%;width:max-content}.comparison4000 th,.comparison4000 td{min-width:170px;max-width:320px;padding:10px 16px!important;white-space:normal!important;overflow-wrap:anywhere;background:var(--brand-surface);border-bottom:1px solid var(--brand-border)}.comparison4000 thead th{position:sticky;top:0;z-index:3;background:var(--brand-sidebar);height:48px}.comparison4000 tr>*:first-child{position:sticky;left:0;z-index:2;min-width:235px;max-width:300px;background:var(--brand-surface);box-shadow:1px 0 var(--brand-border)}.comparison4000 thead th:first-child{z-index:4;background:var(--brand-sidebar)}.comparison4000 .group4000 th{background:var(--brand-active);font-weight:700}.comparison4000 tbody th{text-align:left}.comparison4000 td{text-align:center}.comparison4000 tbody th span{font-weight:400;color:var(--brand-text-muted)}
@media(max-width:1100px){.setup-layout4000{grid-template-columns:1fr}.setup-steps4000{position:static;display:flex;flex-wrap:wrap}.setup-steps4000 a{padding:8px}.installation-grid4000{grid-template-columns:1fr}}
@media(max-width:700px){.platform-fields4000{grid-template-columns:1fr}.status-list4000 div{grid-template-columns:1fr;gap:6px}.comparison4000 tr>*:first-child{min-width:160px;max-width:190px}.setup-footer4000 .button{flex:1}}
.brand-preview4000 img{max-width:180px;max-height:72px;object-fit:contain;margin-bottom:12px}.brand-preview4000 [hidden]{display:none}

/* Wizard controls retain comfortable spacing at all supported widths. */
.setup-content4000{padding:clamp(18px,2vw,32px)}
.setup-content4000>p{line-height:1.65;margin:12px 0 22px}
.platform-form4000 .platform-fields4000{column-gap:28px;row-gap:24px}
.platform-form4000 label{margin:0;line-height:1.45;font-weight:600}
.platform-form4000 input:not([type=checkbox]),.platform-form4000 select,.platform-form4000 textarea{min-height:44px;padding:10px 12px;border:1px solid var(--brand-input-border);border-radius:8px;background:var(--brand-input);color:var(--brand-text)}
.platform-field4000.checkbox4000{align-self:start;min-height:44px;align-items:flex-start;padding-top:8px}
.platform-field4000.checkbox4000 input{margin-top:4px}
.setup-content4000 .button{white-space:normal;text-align:center}
.rich-editor[hidden],.rich-toolbar[hidden]{display:none}
.rich-editor{min-height:300px;overflow-wrap:anywhere}
@media(max-width:500px){.setup-steps4000{display:grid;grid-template-columns:1fr 1fr;font-size:12px}.setup-steps4000 a{align-items:flex-start}.setup-content4000{padding:16px}.actions4000{align-items:stretch}.actions4000>.button{flex:1 1 180px}}

/* R5: logos fit within a definite box, including unusually tall images. */
.company-logo-preview>span,.company-account-logo{box-sizing:border-box;display:flex;align-items:center;justify-content:center;overflow:hidden}
.company-logo-preview>span{width:180px;height:110px;padding:8px;flex-shrink:0}
.company-logo-preview>span>img,.company-account-logo>img{display:block;width:100%!important;height:100%!important;object-fit:contain!important;object-position:center;border-radius:0}
.company-tab-locked{display:inline-flex;align-items:center;padding:10px 14px;color:var(--brand-text-muted);cursor:not-allowed}
.widget-choice:has(input:disabled){opacity:.65}

.company-account-logo{padding:4px}
@media(max-width:600px){.company-logo-preview{flex-wrap:wrap}.company-logo-preview>div{min-width:0;overflow-wrap:anywhere}}

/* R6: invoice tables and symmetric party information. */
.portal-document-workspace .party-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:stretch;margin:20px 0}
.portal-document-workspace .party-grid>section,.portal-document-workspace .party-grid>article,.portal-document-workspace .party-grid>div{min-width:0;padding:18px;box-sizing:border-box}
.portal-document-workspace .party-grid .structured-list>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:12px;padding:9px 0}
.portal-document-workspace .party-grid dt,.portal-document-workspace .party-grid dd{margin:0;overflow-wrap:anywhere;min-width:0}
.portal-document-workspace .profile-limited-note{margin:12px 0 18px;padding:12px;line-height:1.5}
.invoice-table-compact{min-width:1020px;width:100%;table-layout:auto}
.invoice-table-compact th,.invoice-table-compact td{padding:12px 10px;vertical-align:top}
.invoice-table-compact td:nth-child(2){min-width:180px;max-width:250px;overflow-wrap:anywhere}
.invoice-table-compact td:nth-child(3){min-width:140px;max-width:220px;overflow-wrap:anywhere}
.invoice-table-compact td:nth-child(4),.invoice-table-compact td:nth-child(5),.invoice-table-compact td:nth-child(10){white-space:nowrap}
.invoice-table-compact td:nth-child(6),.invoice-table-compact td:nth-child(8){max-width:110px;font-size:12px;overflow-wrap:anywhere}
.invoice-table-compact td:nth-child(7){min-width:150px;max-width:195px}
.invoice-filename{display:block;color:var(--muted);margin-top:5px}
.portal-3313 .new-badge,.new-badge{background:var(--brand-primary)!important;color:var(--brand-on-primary)!important;border:1px solid var(--brand-primary);padding:2px 6px;border-radius:5px;font-size:10px;letter-spacing:.04em;line-height:1.3}
@media(max-width:1250px){.portal-document-workspace .party-grid{grid-template-columns:minmax(0,1fr)}}

/* R7 shared portal stylesheet, also loaded by base.html. */
.import-actions{display:inline-flex;gap:8px;flex-wrap:wrap;align-items:center}
.import-locked{position:relative;cursor:help;opacity:.8;gap:6px}
.import-locked svg{width:16px;height:16px}
.import-hint{display:none;position:absolute;z-index:50;top:100%;right:0;width:260px;max-width:80vw;padding:12px;border:1px solid var(--brand-border);border-radius:8px;background:var(--brand-surface);color:var(--brand-text);font-size:13px;white-space:normal;line-height:1.5;box-shadow:0 6px 18px #0002}
.import-locked:hover .import-hint,.import-locked:focus .import-hint{display:block}
.account-statistics-page .account-resources{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))}
.account-resources>.storage-card{margin:0;padding:20px;min-width:0}
.account-resources .storage-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.account-resources .storage-values strong{font-size:18px;overflow-wrap:anywhere}
.trend-scroll{overflow-x:auto;max-width:100%}
.trend-scroll .admin-trend{display:block;width:100%;height:auto;min-width:520px;max-height:330px}
.trend-scroll .admin-trend text{font-family:inherit;font-size:12px;fill:var(--brand-text)}
.admin-trend-legend{display:flex;flex-wrap:wrap;gap:10px 18px;margin:12px 0;font-size:13px}
.admin-trend-legend>span{display:inline-flex;gap:6px;align-items:center}
.admin-trend-legend .admin-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex:none}
.mailbox-state{display:inline-flex;align-items:center;gap:6px;width:fit-content;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:700}
.mailbox-state.is-active{color:#14532d;background:#dcfce7}
.mailbox-state.is-paused{color:#374151;background:#e5e7eb}
.portal-mail-table table{min-width:1020px;table-layout:fixed;width:100%}
.portal-mail-table th:nth-child(1){width:24%}.portal-mail-table th:nth-child(2){width:17%}.portal-mail-table th:nth-child(3){width:11%}.portal-mail-table th:nth-child(4){width:21%}.portal-mail-table th:nth-child(5),.portal-mail-table th:nth-child(6){width:7%}.portal-mail-table th:nth-child(7){width:13%}
.portal-mail-table td{overflow-wrap:anywhere;vertical-align:top}
.portal-mail-table td:nth-child(3){white-space:nowrap}
.portal-mail-table .mail-origin strong{display:block;font-size:14px}
.portal-mail-table .mail-origin small{display:block;line-height:1.5;font-size:12px;margin-top:4px}

/* R8 */
.trend-scroll .admin-trend text,.admin-trend-legend,.admin-trend-legend>span{font-weight:400!important}
.brand-031:has(.is-full-logo)>i{display:none}
.platform-form4000 .errorlist{color:var(--status-danger);margin:6px 0 0;line-height:1.5}
.setup-content4000 .actions4000{margin-top:16px;gap:12px}
@media(max-width:850px){.platform-form4000 .platform-fields4000{grid-template-columns:minmax(0,1fr)}}

.ews-trust-store{margin:20px 0;padding:18px;border:1px solid var(--brand-border);border-radius:10px}
.ews-certificate{padding:16px;margin:14px 0;background:var(--brand-background);border:1px solid var(--brand-border);border-radius:8px}
.ews-certificate dl{display:grid;grid-template-columns:140px minmax(0,1fr);gap:8px}.ews-certificate dd{margin:0;overflow-wrap:anywhere}.ews-certificate h4{margin-top:0}
.ews-trust-store input[type=file]{max-width:100%;margin:8px 0}.ews-trust-store label{display:block;margin:8px 0}
@media(max-width:650px){.ews-certificate dl{grid-template-columns:1fr}.ews-trust-store{padding:12px}}

.account-statistics-page .account-resources-r8{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:22px}
.account-resources-r8 .resource-summary{align-items:flex-start;gap:12px}.account-resources-r8 h2{font-size:15px}.account-resources-r8 .resource-summary b{font-size:24px}.account-resources-r8 .metric-icon{width:34px;height:34px;flex-basis:34px}
.account-details-r8{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin:24px 0}.account-details-r8>.content-card{padding:24px;min-width:0}.account-details-r8 .storage-card{padding:0;border:0;box-shadow:none;margin:0}.account-details-r8 .storage-card>h2{display:none}
.storage-health-r8{display:grid;grid-template-columns:140px minmax(0,1fr);gap:10px;margin:20px 0 0}.storage-health-r8 dd{margin:0;overflow-wrap:anywhere}
.account-limit-rows{display:grid;gap:16px}.account-limit-rows>.resource-summary{border-bottom:1px solid var(--brand-border);padding-bottom:14px}.account-limit-rows .resource-summary b{font-size:20px}.account-limit-rows h2{font-size:15px}
.account-statistics-page .account-kpis .metric-card{padding:14px}.account-statistics-page .account-kpis strong{font-size:25px}.account-statistics-page .account-kpis .metric-icon{width:32px;height:32px;flex-basis:32px}
@media(max-width:1100px){.account-statistics-page .account-resources-r8{grid-template-columns:repeat(2,minmax(0,1fr))}.account-details-r8{grid-template-columns:1fr}}
@media(max-width:550px){.account-statistics-page .account-resources-r8{grid-template-columns:1fr}.storage-health-r8{grid-template-columns:1fr}}
.demo-tour-r8{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px}.demo-tour-r8 a{padding:8px 12px;border:1px solid var(--brand-border);border-radius:6px;background:var(--brand-surface);font-size:13px}

/* R16: readable charts, compact sources and grouped usage. */
.v031 svg.admin-trend text{stroke:none!important;stroke-width:0!important;font-weight:400!important}
.admin-trend-legend,.admin-trend-legend span{font-weight:400!important}
.invoice-origin-r16{display:inline-flex;flex-direction:column;align-items:center;gap:4px;min-width:52px}
.account-details-r16{display:flex!important;flex-direction:column-reverse;gap:18px}
.account-limit-groups-r16{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.limit-group-r16{border:1px solid var(--brand-border);border-radius:12px;padding:18px;min-width:0;background:var(--brand-background)}
.limit-group-r16 h3{margin:0 0 14px;font-size:16px}
.limit-group-r16>div{display:grid;gap:20px}
.limit-group-r16 .resource-summary{min-width:0;align-items:flex-start}
.limit-group-r16 .resource-summary h2{font-size:13px;margin:0 0 5px}
.limit-group-r16 .resource-summary p{font-size:12px;overflow-wrap:anywhere}
@media(max-width:1050px){.account-limit-groups-r16{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.account-limit-groups-r16{grid-template-columns:1fr}}
.send-badge-r16{display:inline-block;border-radius:7px;padding:4px 8px;background:var(--brand-border);font-size:12px}
.send-badge-r16.sent{background:#e0f2fe;color:#075985}.send-badge-r16.receipt{background:#dcfce7;color:#166534}.send-badge-r16.failed{background:#fee2e2;color:#991b1b}
