.rtl-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.rtl-console {
    min-height: 620px;
}

.rtl-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rtl-map-panel {
    min-height: 620px;
    overflow: hidden;
}

#fruitbowl-right-to-light-map {
    min-height: 548px;
    height: 548px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #07100d;
}

.rtl-facts {
    margin-top: 18px;
}

.rtl-selected-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-left: 5px solid rgba(123, 213, 111, 0.9);
    border-radius: 8px;
    background: rgba(8, 18, 14, 0.72);
}

.rtl-selected-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.rtl-selected-heading span,
.rtl-selected-action span {
    color: var(--muted);
    font-weight: 800;
}

.rtl-selected-heading strong {
    display: block;
    margin-top: 4px;
    font-size: 1.25rem;
}

.rtl-selected-heading b {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(155, 220, 126, 0.16);
    color: #bff3a6;
    border: 1px solid rgba(155, 220, 126, 0.34);
}

.rtl-selected-panel p {
    color: var(--muted);
    line-height: 1.45;
}

.rtl-selected-panel dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.rtl-selected-panel dt,
.rtl-selected-panel dd {
    margin: 0;
}

.rtl-selected-panel dt {
    color: var(--muted);
}

.rtl-selected-panel dd {
    font-weight: 900;
}

.rtl-selected-action {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.rtl-selected-action strong {
    display: block;
    margin: 4px 0;
}

.rtl-selected-action small {
    color: var(--muted);
}

.rtl-selected-compact {
    display: grid;
    gap: 12px;
}

.rtl-selected-compact p {
    margin-bottom: 0;
}

.rtl-open-detail-button {
    display: grid;
    place-items: center;
    min-height: 40px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 8px;
    background: rgba(255,255,255,.055);
    color: #e9f3ec;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.rtl-open-detail-button:hover {
    border-color: rgba(155,220,126,.42);
    background: rgba(155,220,126,.1);
}

.rtl-detail-drawer-shell {
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
}

.rtl-detail-drawer-scrim {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(0,0,0,.46);
    pointer-events: auto;
    cursor: pointer;
}

.rtl-detail-drawer {
    position: absolute;
    top: 18px;
    right: 18px;
    bottom: 18px;
    width: min(520px, calc(100vw - 36px));
    overflow: auto;
    pointer-events: auto;
    border-left: 5px solid rgba(123, 213, 111, 0.9);
    box-shadow: -24px 0 70px rgba(0,0,0,.42);
    animation: rtlDrawerIn .18s ease-out;
}

.rtl-detail-drawer p {
    color: var(--muted);
    line-height: 1.5;
}

.rtl-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.rtl-detail-facts div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,.035);
}

.rtl-detail-facts dt,
.rtl-detail-facts dd {
    margin: 0;
}

.rtl-detail-facts dt {
    color: var(--muted);
    font-weight: 750;
}

.rtl-detail-facts dd {
    margin-top: 4px;
    font-weight: 950;
}

.rtl-detail-note {
    display: grid;
    gap: 5px;
    margin-top: 14px;
    padding: 12px;
    border-left: 4px solid rgba(232,179,79,.9);
    border-radius: 8px;
    background: rgba(232,179,79,.09);
}

.rtl-detail-note span {
    color: var(--muted);
    line-height: 1.45;
}

@keyframes rtlDrawerIn {
    from {
        transform: translateX(24px);
        opacity: .2;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.rtl-selection-high {
    border-left-color: rgba(239, 91, 88, 0.94);
}

.rtl-selection-high .rtl-selected-heading b {
    background: rgba(239, 91, 88, 0.16);
    border-color: rgba(239, 91, 88, 0.36);
    color: #ffb6b3;
}

.rtl-selection-medium {
    border-left-color: rgba(232, 179, 79, 0.94);
}

.rtl-selection-medium .rtl-selected-heading b {
    background: rgba(232, 179, 79, 0.16);
    border-color: rgba(232, 179, 79, 0.36);
    color: #f4d996;
}

.rtl-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.rtl-metric {
    border-left: 5px solid rgba(155, 220, 126, 0.8);
}

.rtl-metric span,
.rtl-building-card span,
.rtl-explainer-grid span,
.rtl-source-grid span {
    color: var(--muted);
    font-weight: 700;
}

.rtl-metric strong {
    display: block;
    margin: 8px 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.rtl-risk-high,
.rtl-building-high {
    border-color: rgba(239, 91, 88, 0.9);
}

.rtl-risk-medium,
.rtl-building-medium {
    border-color: rgba(232, 179, 79, 0.9);
}

.rtl-risk-low,
.rtl-building-low {
    border-color: rgba(123, 213, 111, 0.9);
}

.rtl-risk-watch,
.rtl-risk-info {
    border-color: rgba(112, 229, 255, 0.85);
}

.rtl-building-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rtl-building-card {
    border: 1px solid var(--border);
    border-left: 5px solid rgba(232, 179, 79, 0.9);
    border-radius: 8px;
    padding: 16px;
    background: rgba(8, 18, 14, 0.76);
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.rtl-building-card:hover,
.rtl-building-card.selected {
    border-color: rgba(245, 248, 239, 0.42);
    background: rgba(15, 30, 24, 0.88);
    transform: translateY(-1px);
}

.rtl-building-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.rtl-building-heading strong {
    display: block;
    margin-top: 4px;
    font-size: 1.15rem;
}

.rtl-building-heading b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    border-radius: 999px;
    padding: 8px 10px;
    color: #0b130f;
    background: linear-gradient(135deg, #9bdc7e, #e8c75d);
}

.rtl-building-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.rtl-building-card dt {
    color: var(--muted);
}

.rtl-building-card dd {
    margin: 0;
    font-weight: 800;
}

.rtl-building-card p {
    margin: 0;
    color: var(--muted);
}

.rtl-explainer-grid,
.rtl-source-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.rtl-explainer-grid article,
.rtl-source-grid article {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    background: rgba(8, 18, 14, 0.72);
}

.rtl-explainer-grid strong,
.rtl-source-grid strong {
    display: block;
    margin: 8px 0;
    font-size: 1.08rem;
}

.rtl-explainer-grid p,
.rtl-source-grid p,
.rtl-explainer-grid small {
    color: var(--muted);
}

.rtl-source-live {
    border-left: 4px solid #9bdc7e;
}

.rtl-source-licence {
    border-left: 4px solid #70e5ff;
}

.rtl-source-watch {
    border-left: 4px solid #e8c75d;
}

.rtl-source-paid {
    border-left: 4px solid #ef5b58;
}

.rtl-visual-panel {
    margin-bottom: 18px;
}

.rtl-visual-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 18px;
    align-items: stretch;
}

.rtl-3d-stage {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 75% 18%, rgba(112, 229, 255, 0.12), transparent 28%),
        radial-gradient(circle at 32% 74%, rgba(240, 107, 216, 0.1), transparent 26%),
        linear-gradient(145deg, rgba(13, 21, 31, 0.98), rgba(4, 8, 13, 0.99));
    perspective: 1180px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 26px 70px rgba(0,0,0,.38);
}

.rtl-3d-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5, 8, 13, .22), rgba(5, 8, 13, .66)),
        radial-gradient(circle at 52% 46%, transparent 0 38%, rgba(0,0,0,.42) 78%);
}

.rtl-3d-skyline {
    position: absolute;
    inset: -8% -4% 18%;
    background:
        linear-gradient(180deg, rgba(89, 125, 164, .18), transparent 44%),
        repeating-linear-gradient(90deg, rgba(120, 138, 158, .16) 0 28px, rgba(35, 46, 59, .2) 28px 54px);
    transform: rotateX(63deg) rotateZ(-18deg) translateY(-28px);
    transform-origin: center;
    opacity: .48;
    filter: blur(.2px);
}

.rtl-3d-water {
    position: absolute;
    left: 4%;
    right: 7%;
    top: 49%;
    height: 62px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(66, 122, 160, .18), rgba(115, 196, 235, .34), rgba(66, 122, 160, .15));
    transform: rotate(-13deg) skewX(-18deg);
    box-shadow: 0 0 34px rgba(112, 229, 255, .18);
    opacity: .86;
}

.rtl-3d-road {
    position: absolute;
    height: 7px;
    border-radius: 999px;
    background: rgba(230, 237, 229, .44);
    box-shadow: 0 0 16px rgba(255,255,255,.14);
    transform-origin: left center;
}

.rtl-3d-road::after {
    content: "";
    position: absolute;
    inset: 3px 0 auto;
    height: 1px;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.8) 0 18px, transparent 18px 34px);
    opacity: .46;
}

.rtl-3d-road-a {
    left: 9%;
    top: 68%;
    width: 76%;
    transform: rotate(-18deg);
}

.rtl-3d-road-b {
    left: 16%;
    top: 25%;
    width: 66%;
    transform: rotate(21deg);
    opacity: .5;
}

.rtl-3d-road-c {
    left: 47%;
    top: 18%;
    width: 45%;
    transform: rotate(86deg);
    opacity: .36;
}

.rtl-3d-grid {
    position: absolute;
    inset: 8% 7% 8%;
    transform: rotateX(63deg) rotateZ(-18deg);
    transform-origin: center;
    border: 1px solid rgba(245, 248, 239, 0.08);
    background:
        linear-gradient(rgba(245, 248, 239, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 248, 239, 0.055) 1px, transparent 1px);
    background-size: 34px 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.46);
    opacity: .7;
}

.rtl-3d-background-block {
    position: absolute;
    left: var(--left);
    top: var(--top);
    width: var(--width);
    height: var(--height);
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, rgba(96, 107, 120, var(--shade)), rgba(23, 30, 39, .7));
    transform: skewY(-12deg);
    box-shadow: 9px 14px 0 rgba(12, 16, 21, .5), 0 12px 24px rgba(0,0,0,.25);
    opacity: .78;
}

.rtl-3d-block {
    position: absolute;
    left: var(--left);
    top: var(--top);
    z-index: 2;
    width: var(--width);
    height: var(--height);
    transform: skewY(-12deg);
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, rgba(232, 179, 79, 0.96), rgba(111, 76, 20, 0.96));
    box-shadow: 16px var(--depth) 0 rgba(232, 179, 79, 0.23), 0 20px 40px rgba(0, 0, 0, 0.5);
}

.rtl-3d-block::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 12px;
    bottom: 14px;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0 4px, transparent 4px 14px);
    opacity: 0.42;
}

.rtl-3d-block::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: inherit;
    pointer-events: none;
}

.rtl-map-label {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 14px);
    z-index: 5;
    width: max-content;
    max-width: 180px;
    transform: translateX(-50%) skewY(12deg);
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(8, 13, 20, .74);
    color: #eaf3ed;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 0 2px 8px #000;
    box-shadow: 0 8px 20px rgba(0,0,0,.32);
}

.rtl-3d-block b {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    transform: translate(-50%, -50%) skewY(12deg);
    border-radius: 999px;
    background: rgba(5, 8, 13, .62);
    color: #fff;
    font-size: .65rem;
    font-weight: 950;
    text-transform: uppercase;
}

.rtl-3d-site {
    width: var(--width);
    background: linear-gradient(180deg, rgba(240, 107, 216, 0.96), rgba(102, 35, 91, 0.96));
    box-shadow: 20px var(--depth) 0 rgba(240, 107, 216, 0.28), 0 0 32px rgba(240,107,216,.28), 0 20px 44px rgba(0, 0, 0, 0.48);
}

.rtl-3d-block.rtl-building-high {
    background: linear-gradient(180deg, rgba(239, 91, 88, 0.96), rgba(109, 31, 30, 0.96));
    box-shadow: 16px var(--depth) 0 rgba(239, 91, 88, 0.22), 0 18px 34px rgba(0, 0, 0, 0.46);
}

.rtl-3d-block.rtl-building-low {
    background: linear-gradient(180deg, rgba(123, 213, 111, 0.96), rgba(34, 85, 42, 0.96));
    box-shadow: 16px var(--depth) 0 rgba(123, 213, 111, 0.22), 0 18px 34px rgba(0, 0, 0, 0.42);
}

.rtl-3d-pin {
    position: absolute;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(245,248,239,.88);
    border-radius: 999px;
    background: #8da7ff;
    color: #08110d;
    font-size: .72rem;
    font-weight: 950;
    box-shadow: 0 8px 20px rgba(0,0,0,.42), 0 0 22px rgba(141,167,255,.36);
}

.rtl-3d-pin-a {
    left: 34%;
    top: 31%;
    background: #ff8ecf;
}

.rtl-3d-pin-b {
    left: 78%;
    top: 30%;
    background: #8da7ff;
}

.rtl-3d-pin-c {
    left: 18%;
    top: 76%;
    background: #9bdc7e;
}

.rtl-3d-copy {
    border: 1px solid var(--border);
    border-left: 5px solid rgba(112, 229, 255, 0.9);
    border-radius: 8px;
    padding: 18px;
    background: rgba(8, 18, 14, 0.72);
}

.rtl-3d-copy strong {
    display: block;
    font-size: 1.35rem;
}

.rtl-3d-copy p,
.rtl-3d-copy dt {
    color: var(--muted);
}

.rtl-3d-copy dl {
    display: grid;
    gap: 12px;
}

.rtl-3d-copy dt,
.rtl-3d-copy dd {
    margin: 0;
}

.rtl-3d-copy dd {
    font-weight: 800;
}

@media (max-width: 1100px) {
    .rtl-layout,
    .rtl-summary-grid,
    .rtl-building-grid,
    .rtl-explainer-grid,
    .rtl-source-grid,
    .rtl-visual-layout {
        grid-template-columns: 1fr;
    }

    .rtl-console,
    .rtl-map-panel,
    #fruitbowl-right-to-light-map {
        min-height: 460px;
    }
}

@media (max-width: 760px) {
    .rtl-detail-facts {
        grid-template-columns: 1fr;
    }

    .rtl-detail-drawer {
        inset: 10px;
        width: auto;
    }
}
