/* Consistent customer-facing surfaces. Partner palettes remain inherited. */
.portal-overlays { display: contents; }
body.app:has(.portal-shell--fortress) { background: #f3f7f9 !important; }
html[data-bs-theme] .portal-shell--fortress .sidebar .portal-menu .portal-mobile-nav-link.active { color: #fff !important; background: rgba(255,255,255,.16) !important; }
.portal-compact-header .portal-profile-caption { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 480px) { .portal-profile-caption-detail { display: none; } }
.portal-mobile-close { min-width: 44px; min-height: 44px; }
#crime-map-container a.crime-portal-back,
#crime-map-container a.crime-portal-back:is(:visited, :hover, :focus, :active) { position: fixed; top: max(12px,env(safe-area-inset-top)); left: max(12px,env(safe-area-inset-left)); z-index: 99; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 10px; background: #fff !important; color: #103957 !important; box-shadow: 0 2px 12px #10395733; font-weight: 600; text-decoration: none; }
.crime-portal-back:focus-visible, #crime-map-container button:focus-visible { outline: 3px solid #103957; outline-offset: 3px; }
#crime-map-container .mapboxgl-ctrl-top-right { top: max(70px,env(safe-area-inset-top) + 70px) !important; }
#crime-map-container .crime-tab-item { background: transparent !important; border: 0; font: inherit; font-weight: 600; }
#crime-map-container :is(.crime-modal-exit-button,.map-filters-button) { min-width: 44px; min-height: 44px; }
.portal-shell--fortress {
    --portal-shell-bg: #103957;
    --portal-topbar-bg: #103957;
    --portal-content-bg: #f3f7f9;
    --portal-ink: #103957;
    --portal-muted: #375567;
    --portal-border: rgba(16, 57, 87, .16);
    --portal-accent-contrast: #103957;
}
.portal-shell--fortress .portal-compact-header { background: #103957 !important; }
[data-bs-theme=premium] .portal-shell--fortress,
[data-bs-theme=essential] .portal-shell--fortress { --portal-accent-contrast: #fff; }
.portal-shell { color: var(--portal-ink); line-height: 1.55; }
.portal-shell:not(.portal-route--crime):not(.portal-route--cancelaccount) .page-content > div {
    padding: clamp(24px, 3vw, 40px) !important;
    margin-top: 0 !important;
}
.portal-shell:not(.portal-route--crime):not(.portal-route--cancelaccount) :is(h1,h2,h3,h4,h5,h6) {
    color: var(--portal-ink) !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.portal-shell h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.portal-shell .portal-page-heading { margin-bottom: 24px; }
.portal-shell .portal-page-heading p { max-width: 65ch; margin: 10px 0 0; color: var(--portal-muted); }
.portal-shell .portal-card {
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(16,57,87,.035);
}
.portal-shell :is(.btn,.portal-profile-secondary-button,.portal-profile-save-button) {
    min-height: 44px;
    white-space: normal;
    font-size: 1rem;
    font-weight: 600;
}
.portal-shell .btn-primary { color: var(--portal-accent-contrast) !important; }
.portal-shell:not(.portal-route--crime) :is(input.form-control,textarea.form-control,select.form-control,select.form-select) {
    color: var(--portal-ink) !important;
    background: #fff !important;
    border-color: #8093a0 !important;
    min-height: 48px;
    font: 400 1rem/1.5 system-ui, sans-serif;
    border-radius: 10px;
}
.portal-shell:not(.portal-route--crime) :is(.form-label,.form-text,label) { color: var(--portal-ink); }
.portal-shell:not(.portal-route--crime) .form-text { font-size: .9rem; color: var(--portal-muted) !important; }
.portal-shell:not(.portal-route--crime) :is(.validation-message,.invalid-feedback) {
    color: #a52320 !important;
    font-size: .95rem;
    font-weight: 600;
}
.portal-shell :is(a,button,input,select,textarea,summary):focus-visible {
    outline: 3px solid var(--portal-ink);
    outline-offset: 3px;
}
.portal-shell .header :is(a,button):focus-visible,
.portal-shell .sidebar :is(a,summary):focus-visible { outline-color: #fff; }
.portal-skip-link { position: fixed; top: -100px; left: 16px; z-index: 12000; padding: 12px 20px; background: #fff; color: #103957; border-radius: 8px; }
.portal-skip-link:focus { top: 12px; }
.portal-loading { display: flex; align-items: center; gap: 12px; padding: 20px 0; color: var(--portal-muted); }
.portal-account-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.portal-account-nav a {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 10px 18px; border-radius: 12px;
    border: 1px solid var(--portal-border); background: #fff;
    color: var(--portal-ink) !important; font-weight: 600; text-decoration: none !important;
}
.portal-account-nav a[aria-current=page] { background: var(--portal-ink); border-color: var(--portal-ink); color: #fff !important; }
.portal-account-panel { min-width: 0; }
.portal-account-panel > h2 { margin-bottom: 20px; font-size: 1.4rem; }
.portal-account-grid, .portal-shell .credential-screen { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,24rem),1fr)); gap: 24px; padding: 0; align-items: start; }
.portal-account-grid > section, .portal-shell .credential-screen > section { min-width: 0; padding: 24px; }
.portal-account-grid > .portal-account-wide { grid-column: 1 / -1; }
.portal-shell .credential-container { padding: 0; max-width: none; width: 100%; background: transparent; display: grid; gap: 18px; }
.portal-shell .credential-container > div { min-width: 0; }
.portal-shell .customer-info-card { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap: 20px; padding: 0; }
.portal-shell .customer-info-card-item { min-width: 0; overflow-wrap: anywhere; }
.portal-shell .customer-info-card-item b { display: block; margin-bottom: 4px; }
.portal-form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.portal-form-feedback { margin: 12px 0 0; }
.portal-address-fields { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }
.portal-document-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,22rem),1fr)); gap: 12px; }
.portal-document-list button { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 14px 18px; }
.portal-document-list button i { flex-shrink: 0; }
.portal-shell .contacts-item { min-width: 0; display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--portal-border); }
.portal-shell .contacts-item span { overflow-wrap: anywhere; }
.portal-shell .contacts-item a { white-space: nowrap; }
.portal-shell .contacts-paginator { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }
.portal-shell .contacts-paginator button { min-height: 44px; padding: 8px 16px; }
.portal-menu { display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; }
.sidebar .portal-menu :is(a,summary) { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: 10px; color: #fff !important; text-decoration: none; font-weight: 600; }
.sidebar .portal-menu a.active { background: var(--portal-active-bg); }
.sidebar .portal-menu :is(a,summary):hover { background: rgba(255,255,255,.1); }
.sidebar .portal-menu summary { cursor: pointer; list-style: none; }
.sidebar .portal-menu summary::-webkit-details-marker { display: none; }
.sidebar .portal-menu summary::after { content: '+'; margin-left: auto; }
.sidebar .portal-menu details[open] > summary::after { content: '−'; }
.sidebar .portal-menu details > div { padding-left: 20px; }
.sidebar .portal-menu details a { font-size: .92rem; font-weight: 400; }
.portal-nav-logout { border-top: 1px solid var(--portal-border); margin-top: 14px; padding-top: 16px; }
.sidebar .portal-nav-logout { border-color: rgba(255,255,255,.25); }
.fortress-modal .modal-content { color: var(--portal-ink, #103957); background: #fff !important; border-radius: 16px; }
.fortress-modal .modal-header :is(h2,button) { color: var(--portal-ink, #103957) !important; }
.fortress-modal .modal-body { line-height: 1.6; }
.fortress-modal .modal-footer :is(button,.btn) { min-height: 44px; font-size: 1rem; }
.fortress-modal .modal-footer .btn-outline-light { color: var(--portal-ink, #103957) !important; border-color: var(--portal-ink, #103957) !important; }
.portal-feedback-toast { position: relative; padding-right: 56px !important; max-width: min(440px,calc(100vw - 32px)); line-height: 1.5; }
.portal-feedback-toast button { position: absolute; top: 8px; right: 8px; min-width: 44px; min-height: 44px; background: transparent; border: 0; color: inherit; font-size: 1.5rem; }
.portal-shell .portal-status-ring-meter { max-width: 240px; }
.portal-shell .portal-status-ring-core strong { font-size: clamp(2.2rem,3vw,3rem); }
.portal-shell .portal-status-ring-core .portal-status-pending { font-size: clamp(1.2rem,2vw,1.5rem); }
.portal-shell .portal-status-ring-core { gap: 3px; padding: 8px; }
.portal-shell .portal-status-ring-core em { font-size: .8rem; margin: 0; }
.portal-shell .portal-status-ring-core span { font-size: 1rem; line-height: 1.2; }
.portal-shell .credential-container :is(strong,b) { overflow-wrap: anywhere; }
.portal-shell .portal-status-content { grid-template-columns: minmax(160px,.8fr) minmax(220px,1fr); gap: 24px; }
.portal-shell .portal-dashboard-grid { grid-template-columns: minmax(0,1.5fr) minmax(280px,1fr); gap: 24px; }
.portal-shell .portal-action-link { min-height: 76px; }
.portal-shell .portal-message button { min-width: 44px; }
.portal-shell .portal-profile-alias-editor { flex-wrap: wrap; }
.portal-shell .portal-profile-alias-editor input { flex: 1 1 160px; min-width: 0; }
.portal-shell .portal-profile-alias-summary strong { overflow-wrap: anywhere; }
@media (max-width: 1199px) {
    .portal-shell .portal-dashboard-grid { grid-template-columns: 1fr; }
}
.portal-status-page { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; background: #f3f7f9; color: #103957; }
.portal-status-page > section { width: min(100%,560px); padding: clamp(24px,4vw,40px); background: #fff; border: 1px solid #d6e1e6; border-radius: 20px; }
.portal-status-page h1 { color: #103957 !important; font-size: clamp(1.6rem,4vw,2.2rem); margin: 24px 0 16px; }
.portal-status-page label { color: #103957 !important; }
.portal-status-page input { min-height: 48px; font-size: 16px !important; background: #fff !important; color: #103957 !important; border: 1px solid #8093a0; }
.portal-status-page .btn-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; background: #103957 !important; border-color: #103957 !important; color: #fff !important; }
.portal-status-page .portal-status-logo { height: 40px; width: auto; max-width: 100%; }
@media (max-width: 639px) {
    .portal-shell:not(.portal-route--crime):not(.portal-route--cancelaccount) .page-content > div { padding: 24px 16px !important; }
    .portal-shell .portal-card { padding: 20px; }
    .portal-account-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .portal-account-nav a { padding: 10px; }
    .portal-account-grid, .portal-shell .credential-screen { gap: 20px; }
    .portal-account-grid > section, .portal-shell .credential-screen > section { padding: 20px; }
    .portal-shell .portal-status-content { grid-template-columns: 1fr; gap: 16px; }
    .portal-shell .portal-status-ring { border: 0; padding: 0; }
    .portal-shell .portal-status-ring-meter { max-width: 148px; }
    .portal-shell .portal-status-ring-core strong { font-size: 2.6rem; }
    .portal-shell .portal-status-ring-core span { font-size: .9rem; }
    .portal-shell .portal-status-ring-core em { font-size: .7rem; }
    .portal-shell .portal-status-details { margin: 0; }
    .portal-address-fields { grid-template-columns: 1fr; }
    .portal-shell .contacts-item { flex-direction: column; gap: 4px; }
    .portal-shell .portal-help-card { gap: 18px; }
    .portal-shell .portal-help-card img { max-width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
    .portal-shell *, .fortress-modal * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
