:root {
    --shell-rail-width: 108px;
    --shell-topbar-height: 58px;
    --shell-border: #d9e0e6;
    --shell-text: #17212c;
    --shell-muted: #687586;
}

* {
    box-sizing: border-box;
}

.blaulicht-app-body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(
        --tenant-page-background,
        #f5f7f9
    );
}

.blaulicht-shell {
    min-height: 100vh;
}

.app-rail {
    position: fixed;
    z-index: 80;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: var(--shell-rail-width);
    color: #fff;
    background:
        linear-gradient(
            180deg,
            var(--tenant-rail-start, #0b2638),
            var(--tenant-rail-end, #126f96)
        );
    box-shadow: 4px 0 18px rgb(0 0 0 / 8%);
}

.rail-brand {
    display: grid;
    justify-items: center;
    gap: 5px;
    min-height: 78px;
    padding: 12px 8px;
    border-bottom: 1px solid rgb(255 255 255 / 10%);
    color: #fff;
    text-decoration: none;
}

.rail-brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--tenant-primary, #e85a32);
    font-weight: 800;
}

.rail-brand-logo {
    width: 58px;
    height: 48px;
    overflow: visible;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.rail-brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: contain;
    object-position: center;
}

.rail-brand-logo-default {
    overflow: hidden;
    border-radius: 7px;
    background: #02070d;
}

.rail-brand-wordmark {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 9px;
    color: #fff;
    background: #f05a3c;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

.rail-brand-wordmark strong {
    margin-top: 2px;
    font-size: 15px;
    line-height: 1;
}

.rail-brand-text {
    font-size: 12px;
    font-weight: 700;
}

.rail-navigation {
    display: grid;
    gap: 2px;
    padding: 8px 0;
}

.rail-item {
    appearance: none;
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 100%;
    min-height: 63px;
    padding: 8px 5px;
    border: 0;
    border-left: 3px solid transparent;
    color: rgb(255 255 255 / 83%);
    background: transparent;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.rail-item:hover {
    color: #fff;
    background: rgb(255 255 255 / 8%);
}

.rail-item.is-active {
    border-left-color: #fff;
    color: #fff;
    background: var(
        --tenant-rail-active,
        #167ca5
    );
}

.rail-item.is-disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.rail-icon {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    font-size: 21px;
    line-height: 1;
}

.rail-label {
    max-width: 92px;
    font-size: 11px;
    line-height: 1.15;
}

.rail-footer {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding: 12px;
}

.rail-footer span {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgb(255 255 255 / 12%);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.shell-main {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--shell-rail-width);
}

.shell-topbar {
    position: sticky;
    z-index: 60;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--shell-topbar-height);
    padding: 0 18px;
    border-bottom: 1px solid var(--shell-border);
    background: rgb(255 255 255 / 96%);
    backdrop-filter: blur(12px);
}

.topbar-department-selector {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    text-align: center;
    z-index: 20;
}

.topbar-department-selector > summary {
    display: grid;
    cursor: pointer;
    list-style: none;
    padding: .35rem .9rem;
    border-radius: .65rem;
}

.topbar-department-selector > summary::after {
    content: '▾';
    position: absolute;
    top: 50%;
    right: -.35rem;
    translate: 0 -50%;
    color: var(--shell-muted);
    font-size: .75rem;
}

.topbar-department-selector > summary::-webkit-details-marker { display: none; }
.topbar-department-selector small { font-size: .68rem; opacity: .7; }
.topbar-department-selector strong { font-size: .92rem; }
.topbar-department-menu {
    position: absolute;
    top: calc(100% + .45rem);
    left: 50%;
    translate: -50% 0;
    min-width: 17rem;
    max-height: 24rem;
    overflow: auto;
    padding: .45rem;
    border: 1px solid var(--shell-border, #d7dee7);
    border-radius: .75rem;
    background: var(--shell-surface, #fff);
    box-shadow: 0 14px 35px rgba(15, 23, 42, .18);
}
.topbar-department-menu button {
    width: 100%;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    padding: .62rem .75rem;
    text-align: left;
    cursor: pointer;
}
.topbar-department-menu button:hover {
    color: #173f52;
    background: #e7f0f4;
}
.topbar-department-menu button:focus-visible {
    outline: 3px solid rgb(232 90 50 / 35%);
    outline-offset: 1px;
}
.topbar-department-menu button[aria-current="true"],
.topbar-department-menu button[aria-current="true"]:hover,
.topbar-department-menu button[aria-current="true"]:focus-visible {
    color: #fff;
    background: #0e526c;
    box-shadow: inset 4px 0 0 #e85a32;
    font-weight: 800;
}

@media (max-width: 760px) {
    .topbar-department-selector { max-width: 42vw; }
    .topbar-department-selector small { display: none; }
    .topbar-department-selector strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.topbar-start,
.shell-topbar-actions {
    display: flex;
    align-items: center;
}

.topbar-start {
    gap: 10px;
}

.shell-topbar-actions {
    gap: 10px;
}

.topbar-brand {
    display: grid;
    grid-template-columns: 1fr;
    color: var(--shell-text);
    text-decoration: none;
}

.topbar-brand-logo {
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    margin-right: 9px;
}

.topbar-brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topbar-brand-logo-default {
    width: 48px;
    overflow: hidden;
    border-radius: 6px;
    background: #02070d;
}

.topbar-brand-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    color: #fff;
    background: #f05a3c;
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
}

.topbar-brand-wordmark strong {
    margin-top: 1px;
    color: #fff;
    font-size: 11px;
    line-height: 1;
}

.topbar-brand strong {
    font-size: 13px;
}

.topbar-brand-name {
    display: inline-flex;
    align-items: baseline;
    letter-spacing: -.015em;
}

.topbar-brand-blaulicht {
    color: #111820;
}

.topbar-brand-2ab {
    color: #d9432f;
}

:root[data-theme="dark"] .topbar-brand-blaulicht {
    color: #fff;
}

:root[data-theme="dark"] .topbar-brand-2ab {
    color: #ff6248;
}

.topbar-brand small {
    color: var(--shell-muted);
    font-size: 10px;
}

.mobile-rail-toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 21px;
}

.shell-tenant,
.shell-user {
    display: grid;
    text-align: right;
}

.shell-tenant small,
.shell-user small {
    color: var(--shell-muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shell-tenant strong,
.shell-user strong {
    max-width: 240px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-user-menu {
    position: relative;
}

.topbar-suggestion-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #efd7a5;
    border-radius: 50%;
    color: #9a6500;
    background: #fff8df;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.topbar-suggestion-button:hover,
.topbar-suggestion-button:focus-visible {
    border-color: #e6b94e;
    background: #fff1bd;
    transform: translateY(-1px);
}

.topbar-suggestion-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.topbar-support-button { color: #d65a1f; }
.support-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); gap: 1.5rem; align-items: start; }
.support-layout--single { grid-template-columns: 1fr; }
.support-form, .support-list, .support-ticket-copy, .support-access-card, .support-tech, .support-review { display: grid; gap: 1rem; }
.support-consent { display: flex; gap: .8rem; padding: 1rem; border: 1px solid var(--color-border, #d9dee7); border-radius: 14px; background: rgba(214,90,31,.06); align-items: flex-start; }
.support-consent input { margin-top: .25rem; inline-size: 1.15rem; block-size: 1.15rem; }
.support-consent span { display: grid; gap: .25rem; }
.support-privacy { padding: .9rem 1rem; border-radius: 12px; background: var(--color-surface-muted, #f4f6f8); }
.support-privacy p { margin: .3rem 0 0; }
.support-cards { display: grid; gap: .75rem; }
.support-card { display: grid; gap: .4rem; padding: 1rem; border: 1px solid var(--color-border, #d9dee7); border-radius: 14px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.support-card:hover { border-color: #d65a1f; transform: translateY(-1px); }
.support-card h3, .support-card p { margin: 0; }
.support-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 1.25rem; align-items: start; }
.support-tech { grid-column: 1 / -1; }
.support-ticket-copy dl, .support-tech dl { display: grid; gap: .75rem; margin: 0; }
.support-ticket-copy dl div, .support-tech dl div { display: grid; gap: .2rem; }
.support-ticket-copy dt, .support-tech dt { font-weight: 700; }
.support-tech code { overflow-wrap: anywhere; }
@media (max-width: 900px) { .support-layout, .support-detail-grid { grid-template-columns: 1fr; } .support-tech { grid-column: auto; } }

.suggestion-layout {
    display: grid;
    grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr);
    gap: 18px;
    align-items: start;
}

.suggestion-form,
.suggestion-list {
    display: grid;
    gap: 18px;
}

.suggestion-form h2,
.suggestion-list h2 {
    margin: 3px 0 5px;
}

.suggestion-form p,
.suggestion-list p {
    margin: 0;
    color: var(--text-muted, #617381);
}

.suggestion-form textarea {
    width: 100%;
    resize: vertical;
}

.suggestion-visibility-badge {
    padding: 7px 11px;
    border-radius: 999px;
    color: #725000;
    background: #fff3c7;
    font-size: 11px;
    font-weight: 750;
}

.suggestion-cards {
    display: grid;
    gap: 12px;
}

.suggestion-card {
    display: grid;
    gap: 9px;
    padding: 17px 18px;
    border: 1px solid var(--shell-border, #d7e0e6);
    border-left: 4px solid #e6b94e;
    border-radius: 8px;
    background: #fff;
}

.suggestion-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted, #617381);
    font-size: 11px;
}

.suggestion-card h3,
.suggestion-card p {
    margin: 0;
}

.suggestion-card p {
    color: var(--text, #273542);
    line-height: 1.55;
}

.suggestion-card > small {
    color: var(--text-muted, #617381);
}

.suggestion-card > a {
    color: var(--tenant-primary-dark, #c94725);
    font-size: 12px;
    font-weight: 700;
}

.suggestion-card--in_development {
    border-left-color: #2879a5;
}

.suggestion-card--active {
    border-left-color: #2f8b5b;
}

.suggestion-card--rejected {
    border-left-color: #b83c46;
}

.suggestion-card__decision {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--surface-subtle, #f6f8f9);
    font-size: 12px;
}

.suggestion-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
    gap: 18px;
    align-items: start;
}

.suggestion-detail-card,
.suggestion-review-form {
    display: grid;
    gap: 20px;
}

.suggestion-detail-card__status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted, #617381);
    font-size: 12px;
}

.suggestion-status--in_development { color: #175c80; background: #e5f3fa; }
.suggestion-status--active { color: #1e6842; background: #e2f5ea; }
.suggestion-status--rejected { color: #902a34; background: #fae6e8; }

.suggestion-detail-card__body {
    font-size: 15px;
    line-height: 1.65;
}

.suggestion-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.suggestion-detail-meta > div {
    padding: 12px;
    border-radius: 6px;
    background: var(--surface-subtle, #f6f8f9);
}

.suggestion-detail-meta dt {
    margin-bottom: 4px;
    color: var(--text-muted, #617381);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.suggestion-detail-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.suggestion-decision {
    padding: 16px;
    border-left: 4px solid var(--tenant-primary, #e85a32);
    border-radius: 7px;
    background: #fff7f3;
}

.suggestion-decision p,
.suggestion-review-form p {
    margin: 5px 0 0;
}

.suggestion-review-form textarea {
    width: 100%;
    resize: vertical;
}

.shell-user-menu > summary {
    cursor: pointer;
    list-style: none;
}

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

.shell-user-menu > summary::-webkit-details-marker {
    display: none;
}

.shell-user-menu-panel {
    position: absolute;
    z-index: 90;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--shell-border);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 10px 28px rgb(9 23 34 / 16%);
}

.shell-user-menu-panel a,
.shell-user-menu-panel button {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 3px;
    color: var(--shell-text);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.shell-user-menu-panel a:hover,
.shell-user-menu-panel button:hover {
    color: var(--tenant-primary-dark, #c94725);
    background: #f4f6f8;
}

.shell-action-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--shell-border);
    border-radius: 5px;
    color: var(--shell-text);
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.shell-action-button:hover {
    border-color: var(
        --tenant-primary,
        #e85a32
    );
}

.shell-environment {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(
        --tenant-primary-dark,
        #c94725
    );
    background: #fff0eb;
    font-size: 9px;
    font-weight: 800;
}

.shell-language .language-switcher {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    width: 72px;
    padding: 2px;
    border: 1px solid var(--shell-border);
    border-radius: 5px;
    background: #f4f6f8;
}

.shell-language .language-switcher-link {
    min-width: 0;
    min-height: 28px;
    border-radius: 3px;
    color: var(--shell-muted);
    font-size: 10px;
}

.shell-language .language-switcher-link.is-active {
    color: #fff;
    background: var(
        --tenant-primary,
        #e85a32
    );
}

.shell-content {
    min-width: 0;
    padding: 18px 20px 36px;
}

.module-flyout {
    position: fixed;
    z-index: 75;
    top: var(--shell-topbar-height);
    bottom: 0;
    left: var(--shell-rail-width);
    width: min(720px, calc(100vw - var(--shell-rail-width)));
    overflow-y: auto;
    border-right: 1px solid rgb(255 255 255 / 10%);
    color: #fff;
    background: #0b3c59;
    box-shadow: 14px 12px 35px rgb(0 0 0 / 22%);
    transform: translateX(-105%);
    visibility: hidden;
    transition:
        transform 160ms ease,
        visibility 160ms ease;
}

.blaulicht-shell.flyout-open .module-flyout {
    transform: translateX(0);
    visibility: visible;
}

.flyout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 12px 18px;
    border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.flyout-header div {
    display: grid;
}

.flyout-header small {
    color: rgb(255 255 255 / 54%);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.flyout-header strong {
    font-size: 18px;
}

.flyout-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 5px;
    color: #fff;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.flyout-panel {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 28px;
    padding: 22px 20px 30px;
}

.flyout-panel:not([hidden]) {
    display: grid;
}

.flyout-column {
    display: grid;
    align-content: start;
    gap: 2px;
}

.flyout-column h2 {
    margin: 0 0 7px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgb(255 255 255 / 16%);
    color: #55aace;
    font-size: 15px;
    font-weight: 500;
}

.flyout-column a,
.flyout-pending {
    display: block;
    padding: 8px 0;
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none;
}

.flyout-column a:hover {
    color: #9edcf2;
}

.flyout-pending {
    color: rgb(255 255 255 / 52%);
}

.shell-overlay {
    position: fixed;
    z-index: 65;
    inset: var(--shell-topbar-height) 0 0
        var(--shell-rail-width);
    border: 0;
    background: rgb(9 23 34 / 26%);
}

@media (max-width: 1000px) {
    .shell-user small,
    .topbar-brand small {
        display: none;
    }

    .flyout-panel {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    :root {
        --shell-rail-width: 104px;
    }

    .app-rail {
        transform: translateX(-100%);
        transition: transform 160ms ease;
    }

    .blaulicht-shell.rail-open .app-rail {
        transform: translateX(0);
    }

    .shell-main {
        margin-left: 0;
    }

    .mobile-rail-toggle {
        display: block;
    }

    .shell-topbar {
        padding: 0 10px;
    }

    .shell-topbar-actions {
        gap: 5px;
    }

    .shell-action-button {
        padding-inline: 8px;
    }

    .module-flyout {
        left: 0;
        width: 100%;
    }

    .flyout-panel {
        grid-template-columns: 1fr;
    }

    .shell-overlay {
        left: 0;
    }

    .shell-content {
        padding: 14px 12px 30px;
    }
}

/* Registry-driven navigation */
.navigation-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.rail-item .navigation-icon {
    width: 17px;
    height: 17px;
}

.module-flyout .flyout-panel[hidden] {
    display: none !important;
}

.module-flyout .flyout-panel {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(220px, 1fr)
        );
    gap: 0;
    min-width: min(760px, calc(100vw - 130px));
    max-width: min(1040px, calc(100vw - 130px));
}

.module-flyout .flyout-column {
    min-width: 0;
    padding: 18px;
    border-right: 1px solid
        var(--shell-border, #dce3e8);
}

.module-flyout .flyout-column:last-child {
    border-right: 0;
}

.flyout-column-header {
    min-height: 54px;
    margin-bottom: 12px;
}

.flyout-column-header h3 {
    margin: 0;
    color: var(--shell-text, #182631);
    font-size:
        calc(
            12px
            * var(--blaulicht-font-scale, 1)
        );
    font-weight: 700;
}

.flyout-column-header p {
    margin: 5px 0 0;
    color: var(--shell-muted, #697985);
    font-size:
        calc(
            9px
            * var(--blaulicht-font-scale, 1)
        );
    line-height: 1.4;
}

.flyout-links {
    display: grid;
    gap: 4px;
}

.flyout-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 48px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--shell-text, #182631);
    text-decoration: none;
    transition:
        background-color 120ms ease,
        border-color 120ms ease;
}

.flyout-link:hover,
.flyout-link:focus-visible {
    border-color:
        var(--shell-border, #dce3e8);
    background:
        var(--tenant-page-background, #f4f7f9);
    outline: none;
}

.flyout-link.is-active {
    border-color:
        color-mix(
            in srgb,
            var(--tenant-primary, #e94f26) 35%,
            #dce3e8
        );
    background:
        color-mix(
            in srgb,
            var(--tenant-primary, #e94f26) 8%,
            white
        );
}

.flyout-link.is-planned {
    cursor: default;
    opacity: 0.58;
}

.flyout-link-icon {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
    color:
        var(--tenant-primary, #e94f26);
}

.flyout-link-icon .navigation-icon {
    width: 16px;
    height: 16px;
}

.flyout-link-content {
    display: grid;
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
}

.flyout-link-content strong {
    overflow: hidden;
    font-size:
        calc(
            10px
            * var(--blaulicht-font-scale, 1)
        );
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flyout-link-content small {
    color: var(--shell-muted, #697985);
    font-size:
        calc(
            8.5px
            * var(--blaulicht-font-scale, 1)
        );
    line-height: 1.35;
}

.flyout-link-badge {
    align-self: center;
    padding: 2px 5px;
    border: 1px solid
        var(--shell-border, #dce3e8);
    border-radius: 999px;
    color: var(--shell-muted, #697985);
    font-size:
        calc(
            7px
            * var(--blaulicht-font-scale, 1)
        );
    white-space: nowrap;
}

@media (max-width: 900px) {
    .module-flyout .flyout-panel {
        grid-template-columns: 1fr;
        min-width: min(520px, calc(100vw - 90px));
        max-width: min(520px, calc(100vw - 90px));
    }

    .module-flyout .flyout-column {
        border-right: 0;
        border-bottom: 1px solid
            var(--shell-border, #dce3e8);
    }

    .module-flyout .flyout-column:last-child {
        border-bottom: 0;
    }
}

/* Phase 4: planned navigation modules */
.rail-item {
    position: relative;
}

.rail-item.is-planned:not(.is-active) {
    opacity: 0.68;
}

.rail-item.is-planned:hover,
.rail-item.is-planned:focus-visible {
    opacity: 1;
}

.rail-planned-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 5px;
    height: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
}

.flyout-module-notice {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid
        var(--shell-border, #dce3e8);
    background:
        var(--tenant-page-background, #f4f7f9);
    color: var(--shell-muted, #697985);
    font-size:
        calc(
            9px
            * var(--blaulicht-font-scale, 1)
        );
}

.flyout-module-notice strong {
    color: var(--shell-text, #182631);
    font-size:
        calc(
            9.5px
            * var(--blaulicht-font-scale, 1)
        );
}

.flyout-module-notice strong::before {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border: 1px solid
        var(--tenant-primary, #e94f26);
    border-radius: 50%;
    content: '';
}

/* Phase 5: counters and accessible mobile navigation */
.mobile-nav-toggle {
    display: none;
}

.navigation-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    border: 0;
    background: rgb(12 25 35 / 45%);
    opacity: 0;
    transition: opacity 180ms ease;
}

.navigation-backdrop.is-visible {
    opacity: 1;
}

.rail-badge,
.flyout-link-counter {
    display: inline-grid;
    flex: 0 0 auto;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    background:
        var(--tenant-primary, #e94f26);
    color: #fff;
    font-size:
        calc(
            8px
            * var(--blaulicht-font-scale, 1)
        );
    font-weight: 700;
    line-height: 1;
}

.rail-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size:
        calc(
            7px
            * var(--blaulicht-font-scale, 1)
        );
}

.flyout-link-counter {
    align-self: center;
}

.flyout-back {
    display: none;
}

body.navigation-mobile-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .mobile-nav-toggle {
        position: fixed;
        top: 9px;
        left: 9px;
        z-index: 1300;
        display: grid;
        width: 38px;
        height: 38px;
        padding: 9px;
        place-content: center;
        gap: 4px;
        border: 1px solid
            var(--shell-border, #dce3e8);
        border-radius: 4px;
        background: #fff;
        color: var(--shell-text, #182631);
        box-shadow:
            0 3px 10px rgb(18 38 53 / 15%);
        cursor: pointer;
    }

    .mobile-nav-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
    }

    body.navigation-mobile-open
        .mobile-nav-toggle {
        color:
            var(--tenant-primary, #e94f26);
    }

    .app-rail {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1250;
        width: min(310px, 86vw);
        max-width: none;
        transform: translateX(-102%);
        transition: transform 180ms ease;
        overflow-y: auto;
        box-shadow:
            8px 0 24px rgb(12 25 35 / 18%);
    }

    body.navigation-mobile-open .app-rail {
        transform: translateX(0);
    }

    .app-rail .rail-brand {
        min-height: 58px;
        padding-left: 58px;
    }

    .app-rail .rail-brand-name {
        display: inline;
    }

    .app-rail .rail-navigation {
        padding: 8px;
    }

    .app-rail .rail-item {
        display: grid;
        grid-template-columns:
            28px minmax(0, 1fr) auto;
        width: 100%;
        min-height: 46px;
        padding: 8px 10px;
        text-align: left;
    }

    .app-rail .rail-icon {
        display: grid;
        place-items: center;
    }

    .app-rail .rail-label {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-rail .rail-badge {
        position: static;
        align-self: center;
    }

    .app-rail .rail-planned-dot {
        position: static;
        align-self: center;
        justify-self: center;
    }

    .module-flyout {
        position: fixed;
        inset: 0;
        z-index: 1280;
        width: 100%;
        max-width: none;
        min-width: 0;
        transform: translateX(102%);
        opacity: 1;
        visibility: hidden;
        transition:
            transform 180ms ease,
            visibility 180ms ease;
        overflow-y: auto;
        background: #fff;
    }

    .module-flyout.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .module-flyout .flyout-header {
        position: sticky;
        top: 0;
        z-index: 2;
        display: grid;
        grid-template-columns:
            auto minmax(0, 1fr) auto;
        align-items: center;
        min-height: 58px;
        padding: 7px 10px;
        background: #fff;
    }

    .flyout-back {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 7px 8px;
        border: 0;
        background: transparent;
        color:
            var(--tenant-primary, #e94f26);
        cursor: pointer;
    }

    .flyout-heading {
        min-width: 0;
        text-align: center;
    }

    .flyout-heading h2 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .module-flyout .flyout-panel {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .module-flyout .flyout-column {
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid
            var(--shell-border, #dce3e8);
    }

    .module-flyout .flyout-column:last-child {
        border-bottom: 0;
    }

    .flyout-column-header {
        min-height: 0;
    }

    .flyout-link {
        min-height: 56px;
    }

    .flyout-link-content strong {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-rail,
    .module-flyout,
    .navigation-backdrop {
        transition: none !important;
    }
}

/* Navigation flyout state repair */
.module-flyout {
    display: block;
}

.module-flyout:not(.is-open) {
    transform: translateX(-105%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.module-flyout.is-open,
.blaulicht-shell.flyout-open .module-flyout {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
