* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #172033;
}

.hidden {
    display: none !important;
}

.brand {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    color: #697386;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.card {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.07);
}

.login-card {
    width: min(420px,100%);
    padding: 32px;
}

.login-card label {
    display: block;
    margin-top: 16px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    margin-top: 6px;
    padding: 11px;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
}

.login-card button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: #172033;
    color: #fff;
    font-weight: 700;
}

.error {
    margin-top: 12px;
    color: #b42318;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #fff;
    border-bottom: 1px solid #dde2e7;
}

header h1 {
    margin: 5px 0;
}

.secondary {
    padding: 9px 12px;
    border: 1px solid #cbd2d9;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 360px;
    gap: 18px;
    padding: 18px;
}

.map-card,
.objects-card {
    background: #fff;
    border: 1px solid #dde2e7;
    border-radius: 12px;
}

.map-card {
    position: relative;
    min-height: 640px;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 640px;
}

#mapMessage {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    padding: 30px;
    text-align: center;
    color: #697386;
    background: rgba(255,255,255,.88);
    z-index: 2;
}

.map-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 1;
    max-width: min(520px,calc(100% - 28px));
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border: 1px solid rgba(0,0,0,.25);
    border-radius: 50%;
}

.objects-card {
    padding: 13px;
}

.object-row {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 13px 10px;
    border: 0;
    border-bottom: 1px solid #edf0f2;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.object-row:hover {
    background: #f7f9fa;
}

.object-row span,
.object-row small {
    color: #697386;
}

.info h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.info-row {
    margin: 4px 0;
    font-size: 13px;
}

@media(max-width:900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .objects-card {
        order: -1;
    }

    .map-card,
    #map {
        min-height: 420px;
    }
}


/* KAI CATEGORY FILTER V0_01 */

.category-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.category-filter {
    appearance: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
}

.category-filter:hover {
    background: #f8fafc;
}

.category-filter.active {
    background: #172033;
    border-color: #172033;
    color: #ffffff;
}

.category-filter.category-c {
    border-color: #fdba74;
    color: #9a3412;
}

.category-filter.category-c:hover {
    background: #fff7ed;
}

.category-filter.category-c.active {
    background: #ea580c;
    border-color: #ea580c;
    color: #ffffff;
}

.category-filter.category-d {
    border-color: #fca5a5;
    color: #991b1b;
}

.category-filter.category-d:hover {
    background: #fef2f2;
}

.category-filter.category-d.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}



/* ===== KAI LOGIN V0_02 START ===== */

.login-wrap {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;

    /*
       Später nur diese Datei austauschen:
       /volume1/BWB_SYSTEM/portal/web/assets/login-background.jpg
    */
    background:
        linear-gradient(
            rgba(15, 23, 42, .42),
            rgba(15, 23, 42, .42)
        ),
        url("/portal/assets/login-background.jpg")
        center center / cover no-repeat;

    background-color: #2f3b46;
    overflow: hidden;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at center,
            rgba(255,255,255,.02),
            rgba(15,23,42,.18)
        );
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(390px, calc(100vw - 40px));
    padding: 34px 34px 0;
    background: rgba(255,255,255,.985);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 10px;
    box-shadow:
        0 18px 55px rgba(0,0,0,.28),
        0 2px 8px rgba(0,0,0,.08);
    overflow: hidden;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-bottom: 28px;
}

.login-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid #172033;
    border-radius: 8px;
    color: #172033;
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.login-brand-text strong {
    color: #172033;
    font-size: 19px;
    font-weight: 700;
}

.login-brand-text span {
    margin-top: 4px;
    color: #697386;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-heading {
    text-align: center;
    margin-bottom: 24px;
}

.login-heading h1 {
    margin: 0 0 7px;
    color: #111827;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
}

.login-heading p {
    margin: 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.45;
}

.login-field {
    margin-top: 13px;
}

.login-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.login-field input {
    width: 100%;
    height: 43px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #cfd6de;
    border-radius: 4px;
    outline: none;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 14px;
    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.login-field input::placeholder {
    color: #9aa3af;
}

.login-field input:focus {
    border-color: #6f8db9;
    box-shadow: 0 0 0 3px rgba(79,110,156,.12);
}

.login-submit {
    width: 100%;
    height: 43px;
    margin-top: 15px;
    padding: 0 14px;
    border: 1px solid #172033;
    border-radius: 4px;
    background: #172033;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition:
        background .15s ease,
        border-color .15s ease,
        transform .05s ease;
}

.login-submit:hover {
    background: #24324a;
    border-color: #24324a;
}

.login-submit:active {
    transform: translateY(1px);
}

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 33px;
    margin-top: 1px;
    font-size: 12px;
}

.login-links a,
.login-privacy a {
    color: #697386;
    text-decoration: none;
}

.login-links a:hover,
.login-privacy a:hover {
    color: #172033;
    text-decoration: underline;
}

.login-error {
    min-height: 18px;
    margin-top: 5px;
    font-size: 12px;
}

.login-privacy {
    padding: 16px 0 22px;
    color: #697386;
    font-size: 11px;
    line-height: 1.45;
}

.login-privacy a {
    color: #172033;
    font-weight: 600;
}

.login-security {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -34px;
    padding: 18px 34px;
    border-top: 1px solid #e5e9ee;
    background: #f7f8fa;
}

.login-security-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid #b8c2cf;
    border-radius: 50%;
    background: #fff;
    color: #172033;
    font-size: 16px;
    font-weight: 700;
}

.login-security > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.login-security strong {
    color: #172033;
    font-size: 13px;
}

.login-security span {
    color: #7b8492;
    font-size: 10px;
    line-height: 1.35;
}

@media (max-width: 560px) {
    .login-wrap {
        padding: 18px;
        align-items: center;
    }

    .login-card {
        width: 100%;
        padding: 28px 24px 0;
        border-radius: 8px;
    }

    .login-security {
        margin: 0 -24px;
        padding: 17px 24px;
    }

    .login-brand {
        margin-bottom: 23px;
    }

    .login-heading h1 {
        font-size: 20px;
    }
}

/* ===== KAI LOGIN V0_02 END ===== */


/* ===== KAI PASSWORD RECOVERY V0_01 ===== */

.login-status {
    min-height: 18px;
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.45;
    color: #697386;
}

.login-status.success {
    color: #176b47;
}

.login-status.error {
    color: #b42318;
}

.login-submit:disabled {
    opacity: .58;
    cursor: default;
}


/* ===== KAI PORTAL LAYOUT V0_01 START ===== */

#portalView {
    min-height: 100vh;
    background: #f5f7fa;
}

.portal-header {
    display: block;
    padding: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e7ec;
}

.portal-topbar {
    min-height: 78px;
    display: grid;
    grid-template-columns: 300px minmax(600px, 1fr) 250px;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    border-bottom: 1px solid #edf0f3;
}

.portal-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.portal-brand .brand {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    color: #172033;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .15em;
    white-space: nowrap;
}

.portal-logo {
    display: block;
    width: 68.9%;
    max-width: 207px;
    height: auto;
    object-fit: contain;
    object-position: left center;
    transform: translateY(4px);
}

.portal-main-nav {
    height: 78px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 2px;
}

.main-nav-item {
    position: relative;
    min-width: 82px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: #667085;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.main-nav-item:hover {
    color: #172033;
    background: #fafbfc;
}

.main-nav-item.active {
    color: #172033;
}

.main-nav-item.active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #172033;
}

.portal-user-area {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 9px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px 6px 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.user-profile:hover {
    background: #f5f7f9;
}

.user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #172033;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
}

.user-profile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.user-profile-text strong {
    max-width: 130px;
    overflow: hidden;
    color: #172033;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-text small {
    margin-top: 3px;
    color: #8a94a3;
    font-size: 10px;
}

.portal-menu-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #dbe1e7;
    border-radius: 50%;
    background: #ffffff;
    color: #172033;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.portal-menu-button:hover {
    background: #f5f7f9;
}

.user-menu {
    position: absolute;
    top: 52px;
    right: 0;
    z-index: 20;
    width: 220px;
    padding: 8px;
    border: 1px solid #dfe4ea;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 38px rgba(23,32,51,.14);
}

.user-menu button {
    width: 100%;
    display: block;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #344054;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
}

.user-menu button:hover {
    background: #f4f6f8;
    color: #172033;
}

.portal-context {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 22px 32px 12px;
}

.portal-context h1 {
    margin: 0 0 5px;
    color: #172033;
    font-size: 23px;
    line-height: 1.25;
}

#summaryText {
    color: #788292;
    font-size: 13px;
}

.portal-filterbar {
    margin: 0 32px 22px;
    min-height: 74px;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 12px 16px;
    border: 1px solid #dfe5eb;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(23,32,51,.04);
}

.portal-search {
    width: 280px;
    flex: 0 0 280px;
}

.portal-search label,
.filter-label {
    display: block;
    margin-bottom: 6px;
    color: #7b8492;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.portal-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d5dce4;
    border-radius: 8px;
    outline: none;
    background: #fbfcfd;
    color: #172033;
    font-size: 13px;
}

.portal-search input:focus {
    border-color: #8398b5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79,110,156,.10);
}

.filter-group {
    min-width: 0;
}

.category-filters,
.status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.category-filter,
.status-filter {
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #d6dde5;
    border-radius: 999px;
    background: #ffffff;
    color: #495466;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.category-filter:hover,
.status-filter:hover {
    background: #f6f8fa;
}

.category-filter.active,
.status-filter.active {
    border-color: #172033;
    background: #172033;
    color: #ffffff;
}

.category-filter.category-c {
    border-color: #e7c4a8;
    color: #9a4d18;
}

.category-filter.category-d {
    border-color: #e9b0b0;
    color: #a12c2c;
}

.category-filter.category-c.active,
.category-filter.category-d.active {
    border-color: #172033;
    background: #172033;
    color: #ffffff;
}

.filter-divider {
    width: 1px;
    height: 42px;
    flex: 0 0 1px;
    background: #e4e8ed;
}

.portal-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 18px;
    padding: 0 32px 30px;
}

.map-card,
.objects-card {
    height: 620px;
    min-height: 620px;
    border: 1px solid #dfe4ea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(23,32,51,.045);
}

.map-card {
    position: relative;
    overflow: hidden;
}

#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 620px;
    min-height: 0;
}

.objects-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.objects-header {
    flex: 0 0 auto;
    padding: 17px 18px 13px;
    border-bottom: 1px solid #edf0f3;
}

.objects-header h2,
.objects-card h2 {
    margin: 0;
    color: #172033;
    font-size: 17px;
}

#objectsList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 10px 10px;
}

.object-row {
    padding: 13px 9px;
}

@media (max-width: 1250px) {
    .portal-topbar {
        grid-template-columns: 220px minmax(500px, 1fr) 210px;
        gap: 12px;
        padding: 0 20px;
    }

    .portal-main-nav {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .main-nav-item {
        min-width: 74px;
        padding: 0 9px;
    }

    .portal-context {
        padding-left: 20px;
        padding-right: 20px;
    }

    .portal-filterbar {
        margin-left: 20px;
        margin-right: 20px;
        gap: 14px;
    }

    .portal-dashboard {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 980px) {
    .portal-topbar {
        grid-template-columns: 1fr auto;
        min-height: auto;
        padding-top: 14px;
    }

    .portal-main-nav {
        grid-column: 1 / -1;
        order: 3;
        width: 100%;
        height: 54px;
    }

    .portal-user-area {
        grid-column: 2;
    }

    .portal-filterbar {
        flex-wrap: wrap;
    }

    .portal-search {
        width: 100%;
        flex: 1 1 100%;
    }

    .filter-divider {
        display: none;
    }

    .portal-dashboard {
        grid-template-columns: 1fr;
    }

    .map-card,
    .objects-card,
    #map {
        height: 500px;
        min-height: 500px;
    }
}

/* ===== KAI PORTAL LAYOUT V0_01 END ===== */



/* ------------------------------------------------------------
   Benutzer - Meine Zugriffe
   ------------------------------------------------------------ */

.access-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(23, 32, 51, .34);
    backdrop-filter: blur(2px);
}

.access-panel {
    width: min(500px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 18px;
    border: 1px solid #dfe4ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(23, 32, 51, .22);
}

.access-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.access-panel-header h2 {
    margin: 4px 0 0;
    font-size: 20px;
    line-height: 1.2;
    color: #172033;
}

.access-panel-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #788292;
}

.access-panel-close {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: #f4f6f8;
    color: #344054;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.access-panel-close:hover {
    background: #e9edf2;
}

.access-panel-identity {
    padding: 13px;
    margin-bottom: 16px;
    border: 1px solid #e4e8ed;
    border-radius: 12px;
    background: #f8fafb;
}

.access-panel-identity strong {
    display: block;
    margin-bottom: 4px;
    color: #172033;
    font-size: 15px;
}

.access-panel-identity span {
    color: #697386;
    font-size: 13px;
}

.access-membership-card {
    padding: 13px;
    margin-top: 12px;
    border: 1px solid #e1e6eb;
    border-radius: 12px;
    background: #ffffff;
}

.access-membership-card:first-child {
    margin-top: 0;
}

.access-membership-card h3 {
    margin: 0 0 14px;
    color: #172033;
    font-size: 16px;
}

.access-detail-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
    padding: 7px 0;
    border-top: 1px solid #eef1f4;
    font-size: 13px;
}

.access-detail-row:first-of-type {
    border-top: 0;
}

.access-detail-label {
    color: #788292;
}

.access-detail-value {
    color: #344054;
    font-weight: 600;
}

@media (max-width: 640px) {
    .access-panel-overlay {
        padding: 12px;
    }

    .access-panel {
        padding: 18px;
    }

    .access-detail-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}


.access-estate-item {
    padding: 10px 0;
    border-top: 1px solid #eef1f4;
}

.access-estate-item:first-of-type {
    border-top: 0;
}

.access-estate-item strong {
    display: block;
    color: #172033;
    font-size: 13px;
    margin-bottom: 3px;
}

.access-estate-item span {
    display: block;
    color: #697386;
    font-size: 12px;
}

.access-estates-empty {
    padding: 4px 0;
    color: #788292;
    font-size: 13px;
}


/* Zugriffs-Panel kompakt V2 */
.access-panel {
    width: min(420px, 100%);
    padding: 14px;
}

.access-panel-header {
    margin-bottom: 12px;
}

.access-panel-header h2 {
    font-size: 18px;
}

.access-panel-identity,
.access-membership-card {
    padding: 10px;
    margin-bottom: 10px;
}

.access-membership-card {
    margin-top: 8px;
}

.access-membership-card h3 {
    margin-bottom: 9px;
    font-size: 14px;
}

.access-detail-row {
    padding: 5px 0;
    grid-template-columns: 120px minmax(0, 1fr);
}

/* Own profile dialog */
.kai-profile-dialog{box-sizing:border-box;width:min(32rem,calc(100vw - 2rem));max-height:calc(100vh - 2rem);overflow:auto;padding:1.5rem;border:1px solid #dfe4ea;border-radius:14px;background:#fff;color:#172033;box-shadow:0 18px 55px rgba(23,32,51,.2);font:1rem/1.5 Arial,sans-serif}
.kai-profile-dialog::backdrop{background:rgba(23,32,51,.34)}
.kai-profile-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.kai-profile-heading h2{font-size:1.25rem;margin:0}
.kai-profile-heading button{border:0;background:transparent;padding:.25rem .5rem;font-size:1.75rem;cursor:pointer}
.kai-profile-dialog label,.kai-profile-label{display:block;font-weight:600;margin:.75rem 0 .25rem;font-size:.875rem}
.kai-profile-email{margin:0 0 1rem;overflow-wrap:anywhere;color:#475467}
.kai-profile-dialog input{box-sizing:border-box;width:100%;padding:.65rem .75rem;border:1px solid #cfd6df;border-radius:7px;font:inherit}
.kai-profile-hint{color:#667085;font-size:.875rem;margin:.5rem 0}
#kaiProfileStatus{min-height:1.5em;margin:1rem 0;font-size:.875rem;overflow-wrap:anywhere}
.kai-profile-error{color:#a12a2a}
.kai-profile-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.5rem}
.kai-profile-actions button{border:1px solid #dfe4ea;border-radius:7px;padding:.6rem .85rem;background:#f4f6f8;color:#172033;font:inherit;font-size:.875rem;cursor:pointer}
#kaiProfileSave{background:#172033;color:#fff;border-color:#172033}
.kai-profile-dialog :disabled{opacity:.6;cursor:default}
.kai-profile-dialog :focus-visible{outline:2px solid #172033;outline-offset:3px}

/* Property navigation: direct document links and native expandable groups. */
.object-link { color: inherit; text-decoration: none; font: inherit; box-sizing: border-box; }
.object-category { display: inline-block; margin-left: 7px; padding: 2px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.object-summary { display: flex; flex-direction: row; align-items: baseline; gap: 8px; list-style: none; box-sizing: border-box; }
.object-summary::-webkit-details-marker { display: none; }
.object-summary::before { content: "▸"; flex: 0 0 12px; color: #697386; }
.object-group[open] > .object-summary::before { content: "▾"; }
.object-children { margin-left: 15px; padding-left: 8px; border-left: 1px solid #dde3eb; }
.object-children .object-link { padding-top: 10px; padding-bottom: 10px; }
.object-link:focus-visible, .object-summary:focus-visible { outline: 2px solid #1d4ed8; outline-offset: -2px; }
.object-overdue { border-left: 3px solid #c62828; }

/* Compact object navigation with search kept above the scrolling results. */
.objects-search { width: 100%; margin-top: 12px; }
.objects-search input { box-sizing: border-box; height: 36px; }
.objects-search label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#objectsList .object-row { padding: 9px 8px; font-size: 13px; line-height: 1.45; color: #344054; }
#objectsList .object-row strong { font-weight: 400; overflow-wrap: anywhere; }
#objectsList .object-category { padding: 1px 5px; font-size: 10px; font-weight: 600; vertical-align: 1px; }

#objectsList .object-location { color: #7b8492; font-size: 11px; font-weight: 400; }

/* Independent switches: a check mark indicates an enabled filter. */
.portal-filterbar { flex-wrap: wrap; }
.category-filter::before, .status-filter::before { content: "✓"; display: inline-block; width: 12px; margin-right: 4px; visibility: hidden; }
.category-filter.active::before, .status-filter.active::before { visibility: visible; }
.category-filter[aria-pressed="false"], .status-filter[aria-pressed="false"] { background: #f7f8fa; color: #697386; border-color: #dfe4ea; }
.category-filter:focus-visible, .status-filter:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 3px; }

/* Restore a cookie session without briefly showing the sign-in form. */
.session-boot {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: 32px;
    color: #607089;
    text-align: center;
}
.session-boot-logo {
    width: min(245px, 70vw);
    height: auto;
    margin-bottom: 12px;
}
.session-boot p { max-width: 440px; margin: 0; line-height: 1.6; }
.session-boot-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid #dbe5f5;
    border-top-color: #2450ba;
    border-radius: 50%;
    animation: kai-session-spin 1s linear infinite;
}
.session-boot-error .session-boot-indicator { display: none; }
.session-boot button,
.portal-load-notice button {
    border: 1px solid #b9cbeb;
    border-radius: 8px;
    background: #fff;
    padding: 9px 14px;
    color: #214f9a;
    font: inherit;
    cursor: pointer;
}
.session-boot button:focus-visible,
.portal-load-notice button:focus-visible { outline: 2px solid #2450ba; outline-offset: 3px; }
.portal-load-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 20px 0;
    padding: 12px 16px;
    border: 1px solid #dbe5f5;
    border-radius: 10px;
    background: #f8faff;
    color: #536782;
    font-size: 14px;
    line-height: 1.5;
}
.portal-load-notice button { flex-shrink: 0; }
.portal-load-error { border-color: #e7d7bc; background: #fffaf1; color: #785021; }
@keyframes kai-session-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .session-boot-indicator { animation: none; } }
@media (max-width: 600px) { .portal-load-notice { align-items: flex-start; flex-direction: column; } }

/* Project planning: open books by construction-file inspection date. */
/* Keep the internal controls beside category and action filters. */
.portal-filterbar { flex-wrap: nowrap; gap: 16px; }
.project-filter-row {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    align-self: center;
    margin-left: auto;
    padding-top: 16px;
    gap: 10px;
}
.project-control-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
.project-ready { color: #0f766e; background: #ccfbf1; }
.project-waiting { color: #6d28d9; background: #ede9fe; }
.project-filter {
    position: relative;
    flex: 0 0 32px;
    width: 32px;
    height: 18px;
    padding: 2px;
    border: 1px solid currentColor;
    border-radius: 999px;
    cursor: pointer;
}
.project-filter::before {
    content: "";
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
    transform: translateX(14px);
}
.project-filter[aria-pressed="false"] { background: #f1f5f9; border-color: #cbd5e1; }
.project-filter[aria-pressed="false"]::before { transform: translateX(0); opacity: .45; }
.project-filter::after, .project-completed-toggle::after {
    content: "";
    position: absolute;
    inset: -6px -3px;
}
.project-filter:hover { box-shadow: 0 0 0 3px #e2e8f0; }
.project-filter:focus-visible, .project-refresh:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 4px; }
.project-completed-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.project-completed-toggle input {
    appearance: none;
    width: 32px;
    height: 18px;
    margin: 0;
    border: 1px solid #94a3b8;
    border-radius: 999px;
    background: #e2e8f0;
    cursor: pointer;
}
.project-completed-toggle input::before {
    content: "";
    display: block;
    width: 12px;
    height: 12px;
    margin: 2px;
    border-radius: 50%;
    background: #64748b;
}
.project-completed-toggle input:checked { background: #cbd5e1; }
.project-completed-toggle input:checked::before { background: #475569; transform: translateX(14px); }
.project-completed-toggle input:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 4px; }
.project-refresh { padding: 0; width: 28px; height: 28px; border: 0; color: #64748b; font: 22px Arial, sans-serif; }
@media (max-width: 760px) {
    .portal-filterbar { flex-wrap: wrap; }
    .project-filter-row { padding-top: 0; }
}
.map-photo-preview { width: 240px; max-width: 65vw; color: #172033; font: 13px Arial, sans-serif; }
.map-photo-preview strong { display: block; margin-bottom: 8px; }
.map-photo-preview img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }
.map-photo-preview p { margin: 8px 0 0; color: #64748b; font-size: 12px; }
.object-row .project-badge, .info .project-badge {
    display: inline-block;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 500;
    padding: 3px 7px;
    border-radius: 5px;
}
.object-row .project-ready, .info .project-ready { color: #0f766e; }
.object-row .project-waiting, .info .project-waiting { color: #6d28d9; }
.legend-diamond { border-radius: 0; transform: rotate(45deg); width: 9px; height: 9px; flex-basis: 9px; margin: 0 2px; }
.legend-section { flex: 1 1 100%; color: #475569; font-size: 11px; border-top: 1px solid #e2e8f0; padding-top: 6px; }

/* A side overlay keeps the property marker visible and never pans the map. */
.map-side-preview { position: absolute; box-sizing: border-box; padding: 12px; background: #fff; border: 1px solid #dbe2ec; border-radius: 10px; box-shadow: 0 6px 24px #17203333; pointer-events: none; overflow: hidden; }
.map-side-preview .map-photo-preview { width: 100%; max-width: none; overflow-wrap: anywhere; }
.map-side-preview .map-photo-preview img { height: auto; max-height: 150px; object-fit: cover; }
