.feature-toggle-console {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.map-context-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background:
        linear-gradient(135deg, rgba(112, 229, 255, .08), transparent 42%),
        rgba(6, 13, 12, .72);
}

.map-context-header h2 {
    margin: 5px 0 2px;
    font-size: 30px;
    line-height: 1;
}

.map-context-header p {
    margin: 0;
    color: #a8b9af;
    font-size: 13px;
}

.map-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a59c;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.map-breadcrumb span,
.map-breadcrumb strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.map-breadcrumb span::after {
    content: "/";
    color: rgba(240, 210, 130, .7);
}

.map-breadcrumb strong {
    color: #f0d282;
}

.map-context-chips {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.map-outcome-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -4px 0 14px;
    padding: 13px 15px;
    border-radius: 8px;
    border: 1px solid rgba(112, 229, 255, .2);
    border-left: 4px solid #70e5ff;
    background: rgba(112, 229, 255, .08);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.map-outcome-note div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.map-outcome-note strong {
    color: #b9f5ff;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.map-outcome-note span {
    color: #dce7df;
    font-size: 13px;
    line-height: 1.45;
}

.map-load-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: -2px 0 14px;
}

.map-load-strip div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 9px;
    align-items: center;
    min-width: 0;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(0, 0, 0, .18);
}

.map-load-strip strong,
.map-load-strip small {
    display: block;
    min-width: 0;
}

.map-load-strip small {
    grid-column: 2;
    color: #9eb0a6;
    font-size: 12px;
    line-height: 1.35;
}

.map-load-strip .working {
    border-color: rgba(112, 229, 255, .24);
    background: rgba(112, 229, 255, .08);
}

.map-load-strip .ready {
    border-color: rgba(123, 213, 111, .24);
    background: rgba(123, 213, 111, .08);
}

.map-load-strip .waiting {
    opacity: .72;
}

.signal-strip.map-signal-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.signal-strip.map-signal-strip .metric-card {
    min-width: 0;
    padding: 14px 13px;
}

.signal-strip.map-signal-strip .metric-card strong {
    font-size: 28px;
}

.signal-strip.map-signal-strip .metric-card span,
.signal-strip.map-signal-strip .metric-card small {
    overflow-wrap: anywhere;
}

.signal-strip.map-signal-strip .metric-card.loading {
    border-color: rgba(112, 229, 255, .18);
    background: linear-gradient(110deg, rgba(255,255,255,.055) 0%, rgba(112,229,255,.10) 42%, rgba(255,255,255,.055) 72%);
    background-size: 220% 100%;
    animation: map-loading-sheen 1.15s ease-in-out infinite;
}

.signal-strip.map-signal-strip .metric-card.loading strong {
    color: #b9f5ff;
}

.map-shell > .map-toolbar {
    position: relative;
    inset: auto;
    margin: 14px;
    pointer-events: auto;
}

.map-explorer-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 12px;
    padding: 0 14px 14px;
    align-items: stretch;
}

.map-viewport {
    position: relative;
    min-height: 700px;
    overflow: hidden;
    border-radius: 8px;
}

.map-viewport #fruitbowl-map {
    min-height: 700px;
    height: 100%;
}

.map-layer-rail {
    align-self: stretch;
    max-height: 700px;
    overflow: auto;
    border-left: 1px solid rgba(255, 255, 255, .10);
    border-radius: 8px;
    background: rgba(6, 13, 12, .72);
}

.map-layer-rail .feature-toggle-heading {
    align-items: flex-start;
}

.map-layer-rail .feature-toggle-heading .ghost-link-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

.map-layer-rail .feature-toggle-grid {
    grid-template-columns: 1fr;
}

.map-layer-rail .feature-toggle-card {
    min-height: 76px;
    padding: 10px;
}

.map-layer-rail .feature-toggle-card small {
    display: none;
}

.map-layer-note {
    display: grid;
    gap: 4px;
    padding: 11px;
    border-radius: 8px;
    background: rgba(112, 229, 255, .08);
    border: 1px solid rgba(112, 229, 255, .16);
    border-left: 4px solid #70e5ff;
}

.map-layer-note strong {
    color: #b9f5ff;
}

.map-layer-note span {
    color: #a8b9af;
    font-size: 12px;
    line-height: 1.45;
}

.feature-toggle-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.feature-toggle-heading span,
.feature-toggle-heading small,
.boundary-mode-toggle span,
.feature-toggle-card small {
    display: block;
    color: #94a59c;
    font-size: 12px;
    line-height: 1.35;
}

.feature-toggle-heading strong,
.boundary-mode-toggle strong,
.feature-toggle-card strong {
    display: block;
}

.feature-toggle-heading strong {
    margin: 2px 0;
    font-size: 18px;
}

.map-style-switcher {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, .72fr);
    align-items: end;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(0, 0, 0, .18);
}

.map-style-switcher span,
.map-style-switcher strong {
    display: block;
}

.map-style-switcher span {
    color: #94a59c;
    font-size: 12px;
    line-height: 1.35;
}

.map-style-switcher strong {
    color: #b9f5ff;
}

.boundary-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(0, 0, 0, .18);
}

.boundary-mode-toggle > div {
    margin-right: auto;
}

.boundary-mode-toggle strong {
    color: #f0d282;
}

.boundary-mode-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #dce7df;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.boundary-mode-toggle input,
.feature-toggle-card input {
    accent-color: #9bdc7e;
}

.feature-toggle-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px;
}

.feature-toggle-card {
    display: grid;
    grid-template-columns: auto 36px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 94px;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-left: 4px solid rgba(148, 165, 156, .42);
    border-radius: 8px;
    background: rgba(0, 0, 0, .2);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.feature-toggle-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .18);
}

.feature-toggle-card input {
    width: 18px;
    height: 18px;
}

.feature-toggle-card i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #f5f8ef;
    font-style: normal;
    font-size: 13px;
    font-weight: 900;
}

.feature-toggle-card span {
    min-width: 0;
}

.feature-toggle-card b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    grid-column: 2 / -1;
    justify-self: start;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #dce7df;
    font-size: 11px;
    line-height: 1.2;
}

.feature-toggle-card b.loading {
    color: #b9f5ff;
}

.feature-toggle-card.off {
    opacity: .56;
}

.feature-toggle-card.on {
    background: linear-gradient(135deg, rgba(123, 213, 111, .12), rgba(232, 179, 79, .06)), rgba(0, 0, 0, .22);
}

.feature-toggle-card.on b {
    background: rgba(123, 213, 111, .16);
    color: #c9f8bd;
}

.feature-toggle-candidate { border-left-color: #7bd56f; }
.feature-toggle-restrictions { border-left-color: #ef8a7e; }
.feature-toggle-owned { border-left-color: #b7f27d; }
.feature-toggle-business { border-left-color: #e8b34f; }
.feature-toggle-strategic { border-left-color: #7aa7ff; }
.feature-toggle-transport { border-left-color: #f0b44a; }
.feature-toggle-power { border-left-color: #70e5ff; }

.feature-toggle-candidate i { background: rgba(123, 213, 111, .16); color: #c9f8bd; }
.feature-toggle-restrictions i { background: rgba(239, 138, 126, .16); color: #ffb7af; }
.feature-toggle-owned i { background: rgba(183, 242, 125, .14); color: #d7ffc1; }
.feature-toggle-business i { background: rgba(232, 179, 79, .15); color: #f0d282; }
.feature-toggle-strategic i { background: rgba(122, 167, 255, .15); color: #c8d9ff; }
.feature-toggle-transport i { background: rgba(240, 180, 74, .16); color: #ffd080; }
.feature-toggle-power i { background: rgba(112, 229, 255, .15); color: #b9f5ff; }

.theme-light .feature-toggle-console,
.theme-light .boundary-mode-toggle,
.theme-light .feature-toggle-card,
.theme-light .boundary-mode-toggle label {
    background: rgba(246, 249, 244, .86);
    border-color: rgba(18, 35, 27, .12);
}

.theme-light .feature-toggle-heading span,
.theme-light .feature-toggle-heading small,
.theme-light .boundary-mode-toggle span,
.theme-light .feature-toggle-card small {
    color: #5d6e64;
}

.theme-light .map-context-header {
    background:
        linear-gradient(135deg, rgba(32, 129, 114, .10), transparent 42%),
        rgba(255, 255, 255, .84);
    border-bottom-color: rgba(18, 35, 27, .12);
}

.theme-light .map-context-header p,
.theme-light .map-breadcrumb {
    color: #53665c;
}

.theme-light .map-breadcrumb strong {
    color: #8a681f;
}

.theme-light .feature-toggle-card strong,
.theme-light .boundary-mode-toggle label {
    color: #183026;
}

@keyframes map-loading-sheen {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

@media (max-width: 1200px) {
    .signal-strip.map-signal-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .map-context-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-context-chips {
        justify-content: flex-start;
    }

    .feature-toggle-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .map-explorer-body {
        grid-template-columns: 1fr;
    }

    .map-layer-rail {
        max-height: none;
    }

    .map-layer-rail .feature-toggle-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .map-layer-rail .feature-toggle-card small {
        display: block;
    }
}

@media (max-width: 900px) {
    .signal-strip.map-signal-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .map-load-strip,
    .map-style-switcher {
        grid-template-columns: 1fr;
    }

    .feature-toggle-heading {
        align-items: stretch;
        flex-direction: column;
    }

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

    .map-layer-rail .feature-toggle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .signal-strip.map-signal-strip {
        grid-template-columns: 1fr;
    }

    .map-outcome-note {
        align-items: flex-start;
        flex-direction: column;
    }

    .map-context-header {
        padding: 14px;
    }

    .map-context-header h2 {
        font-size: 24px;
    }

    .map-breadcrumb {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .feature-toggle-grid {
        grid-template-columns: 1fr;
    }

    .map-explorer-body {
        padding: 0 10px 10px;
    }

    .map-layer-rail .feature-toggle-grid {
        grid-template-columns: 1fr;
    }
}
