.rp2 {
    display: grid;
    grid-template-columns: 260px minmax(300px,1fr) 230px;
    height: calc(100vh - 130px);
    min-height: 620px;
    background: #f2f5f8;
    color: #233047;
    font-family: Segoe UI,Arial,sans-serif;
    border: 1px solid #dce3ea
}

    .rp2 * {
        box-sizing: border-box
    }

    .rp2 button {
        border: 1px solid #cdd6e0;
        border-radius: 8px;
        background: white;
        color: #28364a;
        padding: 8px 10px;
        cursor: pointer;
        white-space: nowrap
    }

        .rp2 button:hover {
            background: #e9eff7
        }

        .rp2 button.primary {
            background: #245bcb;
            color: #fff;
            border-color: #245bcb
        }

        .rp2 button.danger {
            color: #b22b34
        }

    .rp2 input:not([type=checkbox]), .rp2 select {
        width: 100%;
        border: 1px solid #cdd6e0;
        border-radius: 7px;
        padding: 8px;
        background: white;
        color: #27364a
    }

    .rp2 label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 11px
    }

.rp2-sidebar, .rp2-inspector {
    background: white;
    padding: 16px;
    overflow: auto
}

.rp2-sidebar {
    border-right: 1px solid #dce3ea
}

.rp2-inspector {
    border-left: 1px solid #dce3ea
}

.rp2-brand {
    margin-bottom: 20px
}

    .rp2-brand strong {
        display: block;
        font-size: 17px;
        letter-spacing: .4px
    }

    .rp2-brand span {
        color: #2463df
    }

    .rp2-brand small {
        display: block;
        color: #8792a2;
        margin-top: 5px
    }

.rp2-products {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.rp2-product {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 9px;
    white-space: normal !important;
    width: 100%;
    min-height: 57px
}

    .rp2-product img {
        width: 45px;
        height: 42px;
        object-fit: contain;
        background: #f1f3f6;
        border-radius: 5px
    }

    .rp2-product span {
        font-size: 12px;
        line-height: 1.4
    }

    .rp2-product small {
        display: block;
        color: #8592a1
    }

.rp2-help {
    font-size: 11px;
    line-height: 1.6;
    color: #718095;
    margin-top: 20px
}

.rp2-main {
    min-width: 0;
    display: flex;
    flex-direction: column
}

.rp2-toolbar, .rp2-options {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    padding: 9px 12px;
    border-bottom: 1px solid #dce3ea
}

    .rp2-toolbar label {
        margin: 0;
        min-width: 75px;
        max-width: 155px
    }

        .rp2-toolbar label:first-child {
            min-width: 140px
        }

    .rp2-toolbar input {
        padding: 6px !important
    }

    .rp2-options label {
        display: flex;
        gap: 5px;
        align-items: center;
        margin: 0 10px 0 0
    }

    .rp2-options input {
        margin: 0
    }

    .rp2-options #rpStatus {
        margin-left: auto;
        font-size: 12px;
        color: #64748b
    }

.rp2-canvas {
    flex: 1;
    min-height: 300px;
    overflow: hidden;
    background: #edf2f8
}

.rp2-footer {
    padding: 8px 12px;
    font-size: 11px;
    background: #fff;
    color: #7a899c
}

.rp2-inspector h3 {
    font-size: 14px;
    margin: 0 0 14px
}

.rp2-inspector button {
    width: 100%;
    margin: 3px 0
}

.rp2-inspector #rpEmpty, .rp2-inspector #rpModules {
    font-size: 12px;
    line-height: 1.5;
    color: #7d8b9c
}

.rp2-divider {
    height: 1px;
    background: #e1e7ee;
    margin: 18px 0
}

.rp2-modal[hidden], #rpProperties[hidden] {
    display: none
}

.rp2-modal {
    position: fixed;
    inset: 0;
    background: #132039a8;
    z-index: 99999;
    display: grid;
    place-items: center
}

.rp2-modal-card {
    background: white;
    border-radius: 12px;
    padding: 22px;
    width: min(520px,90vw);
    max-height: 70vh;
    overflow: auto;
    position: relative
}

.rp2-close {
    position: absolute;
    right: 14px;
    top: 12px
}

.rp2-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 10px
}

    .rp2-plan-row a {
        color: #245bcb
    }

@media(max-width:1100px) {
    .rp2 {
        grid-template-columns: 210px minmax(300px,1fr)
    }

    .rp2-inspector {
        grid-column: 1/-1;
        max-height: 220px;
        border-top: 1px solid #ddd
    }

        .rp2-inspector #rpProperties {
            display: flex;
            flex-wrap: wrap;
            gap: 8px
        }

            .rp2-inspector #rpProperties label {
                width: 100px
            }
}

@media(max-width:700px) {
    .rp2 {
        display: flex;
        flex-direction: column;
        height: auto
    }

    .rp2-sidebar {
        max-height: 220px
    }

    .rp2-main {
        min-height: 600px
    }

    .rp2-inspector {
        max-height: none
    }
}

/* Navelli V3: dört yönlü ölçüm kartları */
.rp3-distance-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    color: #37516d;
    margin-bottom: 10px
}

.rp3-distances {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px
}

    .rp3-distances > div {
        border: 1px solid #d8e6f4;
        background: #f0f7ff;
        border-radius: 9px;
        padding: 10px 8px;
        font-size: 11px;
        color: #49637f
    }

    .rp3-distances strong {
        display: block;
        font-size: 18px;
        color: #075985;
        margin-top: 4px
    }

.rp3-note {
    font-size: 11px;
    color: #718096;
    line-height: 1.4;
    margin-bottom: 15px
}

#rpModules button:disabled {
    opacity: .45;
    cursor: not-allowed
}

/* V4: gerçek modül kartları ve çoklu seçimin ölçülendirilmesi */
.rp4-selection-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 12px;
    background: #eaf3ff;
    border-bottom: 1px solid #c8ddfa;
    font-size: 12px;
    color: #24496d
}

    .rp4-selection-bar strong {
        color: #0b55b5;
        white-space: nowrap
    }

    .rp4-selection-bar span {
        opacity: .85
    }

.rp4-module-heading {
    font-weight: 700;
    font-size: 12px;
    color: #1f4267;
    margin-bottom: 12px
}

.rp4-module-hint {
    font-size: 12px;
    color: #697b91;
    line-height: 1.5
}

.rp4-module-card {
    border: 1px solid #d9e2ee;
    border-radius: 11px;
    padding: 9px;
    margin: 9px 0;
    background: #f9fbff;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    align-items: center;
    cursor: grab
}

    .rp4-module-card img {
        width: 72px;
        height: 65px;
        object-fit: contain;
        background: white;
        border: 1px solid #e8edf3;
        border-radius: 7px
    }

.rp4-module-info {
    min-width: 0
}

    .rp4-module-info strong {
        display: block;
        font-size: 12px;
        white-space: normal;
        overflow-wrap: anywhere
    }

    .rp4-module-info small {
        display: block;
        color: #63748b;
        margin-top: 5px
    }

.rp4-module-card button {
    grid-column: 1/-1;
    background: #eaf3ff;
    border-color: #a8c8f4;
    color: #1252a3;
    font-weight: 700
}

.rp4-group-summary {
    background: #f1f7ff;
    border: 1px solid #c8def7;
    padding: 12px;
    border-radius: 12px;
    margin: 0 0 15px
}

    .rp4-group-summary h4 {
        font-size: 11px;
        color: #23518a;
        margin: 0 0 10px
    }

    .rp4-group-summary p {
        font-size: 12px
    }

    .rp4-group-summary small {
        font-size: 11px;
        color: #617c99;
        line-height: 1.5;
        display: block
    }

.rp4-group-move {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px
}

    .rp4-group-move button {
        grid-column: 1/-1
    }

    .rp4-group-move label {
        font-size: 11px
    }

/* V5 CAD workspace */
.rp2 {
    height: calc(100vh - 75px);
    min-height: 740px;
    grid-template-columns: 285px minmax(550px,1fr) 285px;
    background: #131d2c
}

.rp2-canvas {
    min-height: 540px;
    background: #172235
}

.rp2-toolbar, .rp2-options {
    background: #edf3fa
}

.rp2-sidebar, .rp2-inspector {
    background: #f9fbff
}

.rp2-footer {
    background: #19283b;
    color: #d2e2f3
}

.rp2-brand strong {
    font-size: 19px
}

.rp5-tabbar {
    display: flex;
    gap: 4px;
    margin: 0 0 14px
}

    .rp5-tabbar button {
        flex: 1;
        white-space: normal;
        font-size: 11px;
        font-weight: 800;
        padding: 9px 5px
    }

        .rp5-tabbar button.active {
            background: #165ec0;
            color: white;
            border-color: #165ec0
        }

.rp5-symbols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px
}

.rp5-symbol {
    white-space: normal !important;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 60px;
    text-align: left !important;
    padding: 8px !important
}

.rp5-symbol-icon {
    font-size: 25px;
    color: #1680bf;
    min-width: 28px
}

.rp5-symbol small {
    display: block;
    color: #7a889a;
    font-size: 10px;
    margin-top: 3px
}

.rp5-symbol span:nth-child(2) {
    font-size: 11px;
    font-weight: 700
}

.rp5-libtitle {
    font-size: 12px;
    font-weight: 800;
    margin: 8px 0 12px;
    color: #284d75
}

.rp5-libnote {
    font-size: 11px;
    color: #65768b;
    line-height: 1.6;
    margin-top: 16px
}

.rp2:fullscreen {
    height: 100vh;
    width: 100vw;
    grid-template-columns: 300px minmax(550px,1fr) 300px
}

.rp2 [hidden] {
    display: none !important
}

@media(max-width:1250px) {
    .rp2 {
        grid-template-columns: 220px minmax(400px,1fr) 245px
    }
}

/* V6: Navelli modules visible beside the product catalog. */
.rp6-module-library {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 2px solid #cdd9e9
}

    .rp6-module-library h3 {
        font-size: 12px;
        letter-spacing: .4px;
        margin: 0 0 8px;
        color: #1c3856
    }

.rp6-status {
    font-size: 11px;
    color: #245bcb;
    background: #eef5ff;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    line-height: 1.5
}

.rp6-module-library #rpModules {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.rp6-module-library .rp4-module-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    max-width: 100%;
    padding: 9px;
    border: 1px solid #dce4ef;
    border-radius: 9px;
    background: #fff
}

    .rp6-module-library .rp4-module-card img {
        display: block;
        max-width: 100%;
        width: 100%;
        height: 110px;
        object-fit: contain;
        background: #f6f8fb
    }

    .rp6-module-library .rp4-module-card button {
        width: 100%;
        background: #245bcb;
        color: white
    }

.rp6-module-library .rp4-module-info strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 12px
}

.rp6-module-library .rp4-module-info small {
    display: block;
    color: #64748b;
    font-size: 11px
}

.rp6-warning {
    color: #b45309;
    overflow-wrap: anywhere
}

.rp2 {
    grid-template-columns: 300px minmax(360px,1fr) 230px
}

/* V7 - editable inner walls */
.rp7-wall-editor {
    background: #fff6ef;
    border: 1px solid #f6c7aa;
    padding: 12px;
    border-radius: 10px;
    margin: 12px 0
}

    .rp7-wall-editor h4 {
        margin: 0 0 8px;
        color: #994419;
        font-size: 12px
    }

    .rp7-wall-editor label {
        display: block;
        margin: 8px 0;
        font-size: 11px
    }

    .rp7-wall-editor input {
        width: 100%;
        box-sizing: border-box
    }

    .rp7-wall-editor button {
        margin: 6px 3px 6px 0
    }

    .rp7-wall-editor small {
        display: block;
        line-height: 1.5;
        color: #855f4b
    }

/* V8 plan import */
.rp8-import {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef5ff;
    border: 1px solid #b8c9df;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 12px;
    cursor: pointer;
    color: #123457
}

    .rp8-import input {
        max-width: 170px;
        font-size: 11px
    }

.rp2-options {
    flex-wrap: wrap
}

.rp2-toolbar {
    flex-wrap: wrap
}

/* V10: editable, synchronized room clearances */
#rp2 .rp-measure-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
    margin: 10px 0 14px;
}

    #rp2 .rp-measure-grid label {
        display: flex;
        flex-direction: column;
        gap: 5px;
        min-width: 0;
        padding: 10px;
        background: #eef5ff;
        border: 1px solid #d4e5fa;
        border-radius: 10px;
        font-size: 12px;
        color: #365879;
    }

    #rp2 .rp-measure-grid input {
        display: block;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 7px 8px;
        border: 1px solid #b6d0ed;
        border-radius: 7px;
        background: white;
        color: #064b82;
        font-size: 16px;
        font-weight: 700;
    }

        #rp2 .rp-measure-grid input:focus {
            outline: 2px solid #2e83d3;
            outline-offset: 1px;
        }

/* V10.1 - single viewport CAD workspace, isolated from the MVC layout */
body.rp-cad-page .main-footer,
body.rp-cad-page #footer,
body.rp-cad-page footer.main-footer,
body.rp-cad-page .content-wrapper > footer,
body.rp-cad-page .wrapper > footer {
    display: none !important;
}

body.rp-cad-page .content-wrapper {
    min-height: 0 !important;
}

    body.rp-cad-page .content-wrapper > .content {
        padding-bottom: 0 !important;
    }

#rp2.rp2 {
    display: grid !important;
    grid-template-columns: minmax(245px, 300px) minmax(0, 1fr) minmax(235px, 280px) !important;
    grid-template-rows: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    height: var(--rp-viewport-height, calc(100vh - 115px)) !important;
    min-height: 420px !important;
    overflow: hidden !important;
}

#rp2 > .rp2-sidebar, #rp2 > .rp2-main, #rp2 > .rp2-inspector {
    height: 100%;
    min-height: 0 !important;
    min-width: 0;
}

#rp2 > .rp2-sidebar {
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

#rp2 #rpCatalog, #rp2 #rpLibrary {
    min-height: 0;
}

#rp2 #rpProducts {
    max-height: min(37vh, 340px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

#rp2 #rpModules {
    max-height: none;
    overflow: visible;
}

#rp2 > .rp2-main {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
}

#rp2 .rp2-toolbar, #rp2 .rp2-options, #rp2 .rp4-selection-bar, #rp2 .rp2-footer {
    flex: 0 0 auto;
}

#rp2 #rpCanvas {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#rp2 > .rp2-inspector {
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

#rp2:fullscreen {
    --rp-viewport-height: 100vh;
    grid-template-columns: 300px minmax(0,1fr) 280px !important;
}

@media (max-width:1100px) {
    #rp2.rp2 {
        grid-template-columns: 220px minmax(0,1fr) 235px !important;
    }

    #rp2 > .rp2-inspector {
        grid-column: auto;
        max-height: none;
    }
}

@media (max-width:780px) {
    #rp2.rp2 {
        grid-template-columns: 190px minmax(0,1fr) 205px !important;
        min-width: 0;
    }
}

/* V10.2: compact CAD command bars, maximize usable drawing area */
#rp2 .rp2-toolbar, #rp2 .rp2-options {
    gap: 4px 5px !important;
    padding: 5px 7px !important;
    align-content: start;
}

    #rp2 .rp2-toolbar button, #rp2 .rp2-options button {
        font-size: 11px !important;
        line-height: 1.15 !important;
        padding: 5px 7px !important;
        min-height: 28px !important;
        border-radius: 6px !important;
    }

    #rp2 .rp2-toolbar label {
        font-size: 10px !important;
        margin: 0 2px 0 0 !important;
        min-width: 65px !important;
        max-width: 125px !important;
        line-height: 1.1 !important;
    }

        #rp2 .rp2-toolbar label:first-child {
            min-width: 115px !important;
            max-width: 155px !important;
        }

    #rp2 .rp2-toolbar input {
        font-size: 11px !important;
        height: 28px !important;
        padding: 4px 6px !important;
    }

    #rp2 .rp2-options label {
        font-size: 11px !important;
        margin: 0 6px 0 0 !important;
        line-height: 1.2 !important;
    }

        #rp2 .rp2-options label input[type=checkbox] {
            width: 13px !important;
            height: 13px !important;
        }

    #rp2 .rp2-options .rp8-import {
        font-size: 11px !important;
        padding: 3px 5px !important;
        gap: 6px !important;
    }

    #rp2 .rp2-options input[type=file] {
        font-size: 10px !important;
        max-width: 155px !important;
        padding: 2px !important;
    }

    #rp2 .rp2-options #rpStatus {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

#rp2 .rp4-selection-bar {
    padding: 4px 8px !important;
    min-height: 25px !important;
    font-size: 10px !important;
    gap: 8px !important;
}

#rp2 .rp2-footer {
    padding: 4px 8px !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
}

#rp2 .rp2-sidebar, #rp2 .rp2-inspector {
    padding: 10px !important;
}

#rp2 #rpCanvas {
    min-height: 0 !important;
}

/* Public-site integration v2: prevent the fixed marketing header from covering CAD. */
body:has(#rp2) .site-header {
    height: 42px !important;
    background: #191919 !important;
}

    body:has(#rp2) .site-header .header-wrapper,
    body:has(#rp2) .site-header .mobile-toggle {
        display: none !important;
    }

body:has(#rp2) > main {
    padding-top: 43px !important;
}

    body:has(#rp2) > main > #rp2 {
        margin: 0 !important;
    }

body:has(#rp2) > footer, body:has(#rp2) > .site-footer {
    display: none !important;
}

#rp2.rp2 {
    height: calc(100dvh - 43px) !important;
    min-height: 500px !important;
    grid-template-columns: minmax(245px, 285px) minmax(0, 1fr) minmax(240px, 290px) !important;
}

#rp2 .rp2-toolbar, #rp2 .rp2-options {
    max-height: 114px;
    overflow-y: auto;
    scrollbar-width: thin;
}

#rp2 .rp2-brand {
    margin-bottom: 10px;
}

#rp2 #rpProducts {
    max-height: min(42dvh, 420px);
    min-height: 80px;
}

#rp2 .rp-catalog-message {
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #d8a64b;
    background: #fff8e9;
    color: #64440e;
    border-radius: 8px;
    font-size: 13px;
}

    #rp2 .rp-catalog-message[hidden] {
        display: none;
    }

@media(max-width: 980px) {
    #rp2.rp2 {
        grid-template-columns: 230px minmax(0,1fr) !important;
    }

    #rp2 > .rp2-inspector {
        display: none;
    }
}

@media(max-width: 640px) {
    #rp2.rp2 {
        height: auto !important;
        min-height: calc(100dvh - 43px) !important;
        display: flex !important;
        flex-direction: column;
    }

    #rp2 > .rp2-sidebar {
        max-height: 340px;
    }

    #rp2 > .rp2-main {
        min-height: 620px;
    }

    #rp2 #rpCanvas {
        min-height: 360px !important;
    }
}

/* V3: the public Navbar is fixed; keep only its utility row on CAD page. */
html:has(#rp2), body:has(#rp2) {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

    body:has(#rp2) .site-header:not(.home-page) {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        z-index: 1000 !important;
        background: #171717 !important;
    }

    body:has(#rp2) .site-header > .container,
    body:has(#rp2) .site-header .header-wrapper,
    body:has(#rp2) .site-header .mobile-toggle {
        display: none !important;
    }

    body:has(#rp2) .site-header .top-utility-bar {
        display: block !important;
        position: relative !important;
        height: 42px !important;
        min-height: 42px !important;
    }

    body:has(#rp2) main {
        position: relative !important;
        display: block !important;
        margin: 42px 0 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        height: calc(100dvh - 42px) !important;
        overflow: hidden !important;
    }

        body:has(#rp2) main > #rp2.rp2 {
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
            height: 100% !important;
            min-height: 0 !important;
            grid-template-columns: 300px minmax(0,1fr) 280px !important;
        }

            body:has(#rp2) main > #rp2.rp2 > .rp2-main {
                min-height: 0 !important;
            }

    body:has(#rp2) #rp2 .rp2-toolbar {
        max-height: none !important;
        overflow: visible !important;
    }

    body:has(#rp2) #rp2 .rp2-options {
        max-height: 110px !important;
        overflow-y: auto !important;
    }

    body:has(#rp2) #rp2 #rpCanvas {
        min-height: 0 !important;
    }

    body:has(#rp2) > footer {
        display: none !important;
    }

@media(max-width:1050px) {
    body:has(#rp2) main > #rp2.rp2 {
        grid-template-columns: 230px minmax(0,1fr) !important;
    }

    body:has(#rp2) #rp2 > .rp2-inspector {
        display: none !important;
    }
}

@media(max-width:700px) {
    html:has(#rp2), body:has(#rp2) {
        overflow: auto !important;
    }

        body:has(#rp2) main {
            height: auto !important;
            overflow: visible !important;
        }

            body:has(#rp2) main > #rp2.rp2 {
                display: flex !important;
                flex-direction: column !important;
                height: auto !important;
            }

        body:has(#rp2) #rp2 > .rp2-main {
            min-height: 650px !important;
        }
}

/* V5: robust three-column layout, independent of old conflicting rules. */
@media (min-width: 761px) {
    body:has(#rp2) main > #rp2.rp2 {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) !important;
        grid-template-columns: 300px minmax(0, 1fr) 280px !important;
        grid-template-areas: "models drawing properties" !important;
        align-items: stretch !important;
    }

    body:has(#rp2) #rp2 > .rp2-sidebar {
        grid-area: models !important;
        grid-column: auto !important;
        grid-row: 1 !important;
    }

    body:has(#rp2) #rp2 > .rp2-main {
        grid-area: drawing !important;
        grid-column: auto !important;
        grid-row: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body:has(#rp2) #rp2 > .rp2-inspector {
        grid-area: properties !important;
        grid-column: auto !important;
        grid-row: 1 !important;
    }

    body:has(#rp2) main > #rp2.rp2.rp-hide-left {
        grid-template-columns: minmax(0, 1fr) 280px !important;
        grid-template-areas: "drawing properties" !important;
    }

    body:has(#rp2) main > #rp2.rp2.rp-hide-right {
        grid-template-columns: 300px minmax(0, 1fr) !important;
        grid-template-areas: "models drawing" !important;
    }

    body:has(#rp2) main > #rp2.rp2.rp-hide-left.rp-hide-right {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: "drawing" !important;
    }

    body:has(#rp2) #rp2.rp-hide-left > .rp2-sidebar,
    body:has(#rp2) #rp2.rp-hide-right > .rp2-inspector {
        display: none !important;
    }
}

@media (min-width: 761px) and (max-width: 1100px) {
    body:has(#rp2) main > #rp2.rp2 {
        grid-template-columns: 230px minmax(0,1fr) 240px !important;
    }

        body:has(#rp2) main > #rp2.rp2.rp-hide-left {
            grid-template-columns: minmax(0,1fr) 240px !important;
        }

        body:has(#rp2) main > #rp2.rp2.rp-hide-right {
            grid-template-columns: 230px minmax(0,1fr) !important;
        }

        body:has(#rp2) main > #rp2.rp2.rp-hide-left.rp-hide-right {
            grid-template-columns: minmax(0,1fr) !important;
        }

    body:has(#rp2) #rp2 > .rp2-inspector {
        display: block !important;
    }

    body:has(#rp2) #rp2.rp-hide-right > .rp2-inspector {
        display: none !important;
    }
}

#rp2 #rpLibrary[hidden], #rp2 #rpCatalog[hidden] {
    display: none !important;
}

#rp2 #rpLibrary:not([hidden]) {
    display: block !important;
}

#rp2 #rpSymbols {
    display: grid !important;
    grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
    gap: 8px;
}

    #rp2 #rpSymbols .rp5-symbol {
        min-width: 0;
    }
/* DRAWING LIBRARY - İKİ SÜTUN */
#rp2 #rpModules {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-content: start;
}

    #rp2 #rpModules > * {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    #rp2 #rpModules .rp2-module-card {
        padding: 9px !important;
        font-size: 12px !important;
    }

/* SIDEBAR GENİŞLİK KONTROLLERİ */
#rp2 {
    --rp-sidebar-width: 360px;
}

    #rp2.rp2 {
        grid-template-columns: var(--rp-sidebar-width) minmax(0, 1fr) 280px !important;
    }

    #rp2 .rp-sidebar-resize {
        display: flex;
        gap: 6px;
        margin: 8px 0;
    }

        #rp2 .rp-sidebar-resize button {
            width: 34px;
            height: 30px;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            background: #fff;
            cursor: pointer;
        }

            #rp2 .rp-sidebar-resize button:hover {
                background: #eaf2ff;
            }

    /* ROOM PLANNER BAŞLIK */
    #rp2 .rp2-brand strong {
        font-size: 19px !important;
        letter-spacing: -0.4px;
        white-space: nowrap;
    }

    #rp2 .rp2-brand small {
        font-size: 11px !important;
    }

    /* =========================================
   DRAWING LIBRARY - 2 SÜTUN
   ========================================= */

    #rp2 #rpModules {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        align-content: start !important;
    }

        /* JavaScript ile oluşturulan sembol kartları */
        #rp2 #rpModules > * {
            display: flex !important;
            flex-direction: column !important;
            align-items: flex-start !important;
            justify-content: center !important;
            width: 100% !important;
            min-width: 0 !important;
            max-width: none !important;
            margin: 0 !important;
            padding: 10px 8px !important;
            box-sizing: border-box !important;
        }

            /* Kartların içindeki yazılar */
            #rp2 #rpModules > * * {
                max-width: 100% !important;
                overflow-wrap: anywhere;
            }

/* Küçük ekranlarda da iki sütun */
@media (max-width: 768px) {
    #rp2 #rpModules {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ============================================
   DRAWING LIBRARY / MODULES - 2 COLUMN FIX
   ============================================ */

#rp2 #rpModules {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-content: start !important;
}

    /* Başlık iki sütunu kaplasın */
    #rp2 #rpModules > .rp4-module-heading {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin: 0 0 8px !important;
    }

    /* Modül kartları */
    #rp2 #rpModules > .rp4-module-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }

/* Kart içeriği */
#rp2 .rp4-module-info {
    width: 100%;
    min-width: 0;
}

    #rp2 .rp4-module-info strong,
    #rp2 .rp4-module-info small {
        display: block;
        overflow-wrap: anywhere;
    }

/* Yerleştir butonu */
#rp2 .rp4-module-card button {
    width: 100% !important;
    margin-top: 6px !important;
}
/* MVC 2D PATCH: Real Drawing Library columns and resizable sidebar */
#rp2 #rpSymbols.rp5-symbols {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 7px !important;
}

#rp2 #rpSymbols > .rp5-symbol {
    min-width: 0 !important;
    width: 100% !important;
    white-space: normal !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 7px 5px !important;
}

#rp2 #rpSymbols .rp5-symbol-icon {
    min-width: 18px !important;
    font-size: 19px !important;
}

#rp2 #rpSymbols .rp5-symbol span:nth-child(2) {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 10px !important;
}

@media (min-width:761px) {
    body:has(#rp2) main > #rp2.rp2:not(.rp-hide-left):not(.rp-hide-right) {
        grid-template-columns: var(--rp-sidebar-width,360px) minmax(0,1fr) 280px !important;
    }

    body:has(#rp2) main > #rp2.rp2.rp-hide-right:not(.rp-hide-left) {
        grid-template-columns: var(--rp-sidebar-width,360px) minmax(0,1fr) !important;
    }
}

@media (max-width:760px) {
    #rp2 #rpSymbols.rp5-symbols {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }
}

/* V.1 CAD - all drawing controls visible without an inner scrollbar. */
body:has(#rp2) #rp2 .rp2-options {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: center !important;
    gap: 3px 7px !important;
    padding: 4px 7px !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    scrollbar-width: none;
}

    body:has(#rp2) #rp2 .rp2-options #rpExtraMeasureControls {
        display: contents !important;
    }

        body:has(#rp2) #rp2 .rp2-options label,
        body:has(#rp2) #rp2 .rp2-options #rpExtraMeasureControls label {
            display: inline-flex !important;
            align-items: center !important;
            gap: 3px !important;
            margin: 0 !important;
            padding: 1px 0 !important;
            font-size: 10px !important;
            line-height: 1.1 !important;
            white-space: nowrap !important;
        }

        body:has(#rp2) #rp2 .rp2-options button,
        body:has(#rp2) #rp2 .rp2-options #rpExtraMeasureControls button {
            font-size: 10px !important;
            line-height: 1.1 !important;
            min-height: 23px !important;
            padding: 4px 6px !important;
            border-radius: 5px !important;
            white-space: nowrap !important;
        }

    body:has(#rp2) #rp2 .rp2-options input[type="checkbox"] {
        width: 12px !important;
        height: 12px !important;
        margin: 0 !important;
    }

    body:has(#rp2) #rp2 .rp2-options .rp8-import {
        padding: 2px 5px !important;
        font-size: 10px !important;
        gap: 4px !important;
    }

    body:has(#rp2) #rp2 .rp2-options input[type="file"] {
        max-width: 165px !important;
        width: 165px !important;
        font-size: 10px !important;
        padding: 1px !important;
    }

    body:has(#rp2) #rp2 .rp2-options #rpStatus {
        margin-left: 0 !important;
        font-size: 10px !important;
        flex: 1 1 160px;
    }

@media (max-width: 700px) {
    body:has(#rp2) #rp2 .rp2-options {
        gap: 4px !important;
    }
}

/* MOBILE CAD: scene first; model/property drawers and tools are opt-in. */
#rp2 .rp-mobile-nav {
    display: none;
}

@media(max-width:760px) {
    html:has(#rp2), body:has(#rp2) {
        overflow: hidden !important;
    }

        body:has(#rp2) main {
            height: calc(100dvh - 42px) !important;
            overflow: hidden !important;
        }

            body:has(#rp2) main > #rp2.rp2,
            #rp2.rp2 {
                display: flex !important;
                flex-direction: column !important;
                width: 100% !important;
                height: 100% !important;
                min-height: 0 !important;
                overflow: hidden !important;
                position: relative !important;
            }

    #rp2 .rp-mobile-nav {
        display: flex !important;
        flex: 0 0 44px !important;
        align-items: center;
        gap: 4px;
        padding: 4px 6px;
        background: #e9f1fc;
        border-bottom: 1px solid #ccd9e9;
        z-index: 40;
    }

        #rp2 .rp-mobile-nav button {
            flex: 1 1 0;
            min-width: 0;
            padding: 7px 3px !important;
            font-size: 11px !important;
            font-weight: 700;
            white-space: nowrap !important;
        }

            #rp2 .rp-mobile-nav button[aria-expanded=true] {
                background: #215dbd;
                color: white;
            }

    #rp2 > .rp2-main {
        display: flex !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: auto !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    #rp2 .rp-mobile-tools-group {
        display: none !important;
        flex: 0 0 auto;
        max-height: min(42dvh,310px);
        overflow: auto !important;
        background: #f0f5fb;
    }

    #rp2.rp-mobile-tools-open .rp-mobile-tools-group {
        display: block !important;
    }

    #rp2 .rp2-toolbar, #rp2 .rp2-options {
        max-height: none !important;
        overflow: visible !important;
    }

    #rp2 .rp4-selection-bar {
        flex: 0 0 auto !important;
        min-height: 24px;
        max-height: 38px;
        overflow: hidden;
        padding: 3px 6px !important;
    }

        #rp2 .rp4-selection-bar span {
            display: none;
        }

    #rp2 #rpCanvas {
        display: block !important;
        flex: 1 1 0 !important;
        height: auto !important;
        min-height: 220px !important;
        width: 100% !important;
        touch-action: none;
    }

    #rp2 .rp2-footer {
        display: none !important;
    }

    body:has(#rp2) #rp2 > .rp2-sidebar,
    body:has(#rp2) #rp2 > .rp2-inspector {
        display: none !important;
        position: absolute !important;
        top: 44px !important;
        bottom: 0 !important;
        left: 0 !important;
        right: auto !important;
        width: min(92vw,380px) !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        z-index: 60 !important;
        background: #f9fbff !important;
        box-shadow: 5px 0 24px #0003;
    }

    body:has(#rp2) #rp2 > .rp2-inspector {
        left: auto !important;
        right: 0 !important;
        box-shadow: -5px 0 24px #0003;
    }

    body:has(#rp2) #rp2.rp-mobile-models-open > .rp2-sidebar {
        display: block !important;
    }

    body:has(#rp2) #rp2.rp-mobile-props-open > .rp2-inspector {
        display: block !important;
    }

    #rp2 .rp-sidebar-resize {
        display: none !important;
    }

    #rp2 #rpSymbols {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }
}
.rp-home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

    .rp-home-link:hover {
        background: #eff6ff;
        color: #1d4ed8;
    }