:root {
    --bg: #eceff3;
    --card: #fff;
    --ink: #20242a;
    --mut: #8a919c;
    --brand: #c62828;
    --line: #e5e8ed;
    --ok: #1b7f4d;
    --nav: #233c8e
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: system-ui, 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    height: 100vh;
    overflow: hidden
}

#stage {
    position: absolute;
    inset: 0 396px 0 0
}

#stage iframe {
    width: 100%;
    height: 100%;
    border: 0
}

.drag-tab {
    display: none;
}

#toolbar {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .18);
    display: flex;
    align-items: stretch;
    padding: 4px;
    gap: 2px;
    z-index: 5
}

#toolbar .tb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 10px;
    border-radius: 9px;
    cursor: pointer;
    border: 0;
    background: transparent;
    min-width: 58px
}

#toolbar .tb:hover {
    background: #f1f4f8
}

#toolbar .tb.on {
    background: #fdf4f4;
    box-shadow: inset 0 0 0 1.5px var(--brand)
}

#toolbar .tb svg {
    width: 19px;
    height: 19px;
    stroke: #3c4657;
    fill: none;
    stroke-width: 1.7
}

#toolbar .tb.on svg {
    stroke: var(--brand)
}

#toolbar .tb span {
    font-size: 9.5px;
    font-weight: 600;
    color: #3c4657;
    white-space: nowrap
}

#toolbar .div {
    width: 1px;
    background: var(--line);
    margin: 6px 2px
}

#rail {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 396px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dde1e7
}

#railhead {
    padding: 14px 16px 10px;
    display: flex;
    align-items: center;
    gap: 10px
}

#railhead .logo {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .5px
}

#railhead .logo span {
    color: var(--brand)
}

#railhead .price {
    margin-left: auto;
    font-size: 19px;
    font-weight: 800;
    color: var(--brand)
}

#wallpill {
    margin: 0 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #23407c;
    background: #e8effc;
    border: 1px solid #d2dff5;
    border-radius: 8px;
    padding: 7px 11px;
    display: flex;
    align-items: center;
    gap: 7px
}

#wallpill b {
    color: var(--brand)
}

#wallpill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2f6fb3;
    flex: none
}

#sections {
    flex: 1;
    overflow-y: auto;
    padding: 2px 12px 12px
}

.sec {
    background: var(--card);
    border-radius: 12px;
    margin: 0 0 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
    overflow: hidden
}

.sec>.head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    cursor: pointer;
    user-select: none
}

.sec>.head .ic {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f1f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none
}

.sec>.head .ic svg {
    width: 17px;
    height: 17px;
    stroke: #3c4657;
    fill: none;
    stroke-width: 1.7
}

.sec>.head .t {
    font-size: 13.5px;
    font-weight: 700
}

.sec>.head .v {
    margin-left: auto;
    font-size: 12px;
    color: var(--mut);
    font-weight: 600;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.sec>.head .chev {
    color: #aab1bb;
    transition: transform .2s;
    font-size: 15px;
    margin-left: 2px
}

.sec.open>.head .chev {
    transform: rotate(90deg)
}

.sec>.body {
    display: none;
    padding: 2px 14px 14px;
    border-top: 1px solid var(--line)
}

.sec.open>.body {
    display: block
}

.h4 {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--nav);
    margin: 12px 0 6px;
    text-transform: uppercase;
    letter-spacing: .4px
}

.lbl {
    font-size: 11.5px;
    color: var(--mut);
    font-weight: 600;
    margin: 8px 0 4px
}

select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d6dbe2;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: var(--ink)
}

.row2 {
    display: flex;
    gap: 10px
}

.row2>div {
    flex: 1
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 4px
}

.chip {
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid #d6dbe2;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    color: #3c4657
}

.chip:hover {
    border-color: #aab6c6
}

.chip.sel {
    border-color: var(--brand);
    color: var(--brand);
    background: #fdf4f4
}

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

.card {
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 8px 6px 7px;
    text-align: center;
    cursor: pointer;
    background: #fff
}

.card:hover {
    border-color: #b8c2cc
}

.card.sel {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(198, 40, 40, .1)
}

.card img {
    width: 100%;
    height: 44px;
    object-fit: contain
}

.card div {
    font-size: 9.5px;
    font-weight: 600;
    margin-top: 3px;
    line-height: 1.2
}

.card small {
    display: block;
    font-size: 8.5px;
    color: var(--mut);
    font-weight: 600;
    margin-top: 1px
}

.tog {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    cursor: pointer
}

.tog .sw {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #cfd6dd;
    position: relative;
    transition: background .15s;
    flex: none
}

.tog .sw::after {
    content: '';
    position: absolute;
    top: 2.5px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    transition: left .15s
}

.tog.on .sw {
    background: var(--ok)
}

.tog.on .sw::after {
    left: 18px
}

.tog span {
    font-size: 12.5px;
    font-weight: 600
}

.tog small {
    color: var(--mut);
    font-weight: 400
}

.ck {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    cursor: pointer;
    border-bottom: 1px solid #f4f6f8
}

.ck:last-child {
    border-bottom: 0
}

.ck .bx {
    width: 17px;
    height: 17px;
    border: 1.6px solid #c3cbd5;
    border-radius: 4px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff
}

.ck.on .bx {
    background: var(--brand);
    border-color: var(--brand)
}

.ck.on .bx::after {
    content: '\2713';
    color: #fff;
    font-size: 11px;
    font-weight: 800
}

.ck span {
    font-size: 12.5px;
    font-weight: 600
}

.ck small {
    margin-left: auto;
    font-size: 10.5px;
    color: var(--mut);
    font-weight: 600
}

.stp {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 10px;
    margin: 7px 0
}

.stp .nm {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600
}

.stp button {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid #d6dbe2;
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #3c4657
}

.stp b {
    min-width: 18px;
    text-align: center;
    font-size: 13px
}

.ltabs {
    display: flex;
    border-bottom: 2px solid var(--line);
    margin: 8px 0 10px
}

.ltab {
    flex: 1;
    text-align: center;
    padding: 9px 2px;
    font-size: 12.5px;
    font-weight: 700;
    color: #5b6572;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px
}

.ltab.cur {
    color: var(--brand);
    border-bottom-color: var(--brand)
}

.ltab .ind {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.6px solid #c3cbd5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
    flex: none
}

.ltab.act .ind {
    background: var(--brand);
    border-color: var(--brand)
}

.ltab.act .ind::after {
    content: '\2713'
}

.lpane {
    display: none
}

.lpane.cur {
    display: block
}

.lempty {
    text-align: center;
    color: var(--mut);
    font-size: 12.5px;
    padding: 14px 0 6px
}

.wrapbadge {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--brand);
    border: 1px solid #efc7c7;
    background: #fdf4f4;
    border-radius: 12px;
    padding: 3px 9px
}

.pitchrad {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 2px 0 4px
}

.pitchrad .pr {
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1.5px solid #d6dbe2;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: #3c4657
}

.pitchrad .pr.sel {
    border-color: var(--brand);
    color: var(--brand);
    background: #fdf4f4
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 5px 0 2px
}

.swatches i {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08)
}

.swatches i.sel {
    border-color: var(--ink)
}

.note {
    font-size: 11px;
    color: var(--mut);
    margin-top: 6px;
    line-height: 1.45
}

.group {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 8px 0;
    overflow: hidden
}

.group>.ghead {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    background: #fafbfc
}

.group>.ghead .cnt {
    margin-left: auto;
    color: var(--mut);
    font-weight: 600;
    font-size: 11.5px
}

.group>.ghead .chev {
    color: #aab1bb;
    margin-left: 8px;
    transition: transform .2s
}

.group.open>.ghead .chev {
    transform: rotate(90deg)
}

.group>.gbody {
    display: none;
    padding: 2px 12px 10px;
    border-top: 1px solid var(--line)
}

.group.open>.gbody {
    display: block
}

.oprow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f0f2f5
}

.oprow:last-child {
    border-bottom: 0
}

.oprow svg {
    width: 34px;
    height: 34px;
    flex: none
}

.oprow .inf {
    flex: 1;
    min-width: 0
}

.oprow .inf b {
    font-size: 12.5px;
    display: block
}

.oprow .inf small {
    font-size: 11px;
    color: var(--mut);
    line-height: 1.3;
    display: block
}

.oprow select {
    width: 88px;
    flex: none;
    padding: 6px 6px;
    font-size: 12px
}

.oprow .add {
    flex: none;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 700;
    border: 0;
    border-radius: 8px;
    background: var(--nav);
    color: #fff;
    cursor: pointer
}

.oprow .add:hover {
    background: var(--brand)
}

.oprow.off .add {
    background: #c3c9d2;
    cursor: not-allowed
}

#placed {
    border: 1px solid #d9e6d9;
    background: #f4faf4;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 10px 0 2px
}

#placed .pt {
    font-size: 12px;
    font-weight: 700;
    color: #1b5e33;
    margin-bottom: 3px
}

#placed .pi {
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed #d7e3d7;
    display: flex;
    align-items: center
}

#placed .pi:last-child {
    border-bottom: 0
}

#placed .empty {
    font-size: 11.5px;
    color: var(--mut);
    padding: 3px 0
}

#placed .rm {
    margin-top: 7px;
    width: 100%;
    padding: 7px 0;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid #d33;
    color: #d33;
    background: #fff;
    border-radius: 8px;
    cursor: pointer
}

#placed .rm:hover {
    background: #d33;
    color: #fff
}

#cta {
    padding: 10px 12px 12px
}

#cta .quote {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .6px;
    cursor: pointer;
    border: 0;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 6px rgba(198, 40, 40, .35)
}

#cta .row {
    display: flex;
    gap: 8px;
    margin: 8px 0 0 0;
}

#cta .sec2 {
    flex: 1;
    padding: 9px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #d6dbe2;
    background: #fff;
    color: #3c4657
}

.dots {
    display: flex;
    gap: 4px
}

.dots i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15)
}

#placed .pline {
    font-size: 12px;
    padding: 4px 0;
    color: #1c2733
}

#placed .pline b {
    color: #1b5e33
}

#placed .pline a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer
}

#placed .pline a:hover {
    text-decoration: underline
}

#sumWrap {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .45);
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px
}

#sumWrap.open {
    display: flex
}

#sumCard {
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(16, 24, 40, .35);
    width: 520px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

#sumHead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px 12px;
    border-bottom: 1px solid var(--line);
    flex: none
}

#sumHead .st {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--brand);
    text-transform: uppercase
}

#sumHead .sx {
    margin-left: auto;
    cursor: pointer;
    color: #98a2b3;
    font-size: 15px;
    font-weight: 700;
    padding: 4px 6px
}

#sumHead .sx:hover {
    color: var(--brand)
}

#sumBody {
    overflow-y: auto;
    padding: 6px 18px 14px
}

.sumsec {
    margin: 12px 0 2px
}

.sumsec .sh {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--nav);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--line);
    padding-bottom: 5px;
    margin-bottom: 2px
}

.srow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f4f6f8;
    font-size: 12.5px
}

.srow:last-child {
    border-bottom: 0
}

.srow .k {
    color: var(--mut);
    font-weight: 600;
    flex: none;
    width: 170px
}

.srow .w {
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0
}

.srow .w .cdot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
    flex: none
}

.sumempty {
    font-size: 12px;
    color: var(--mut);
    padding: 6px 0
}

#sumNote {
    width: 100%;
    min-height: 58px;
    border: 1px solid #d6dbe2;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 12.5px;
    resize: vertical;
    margin-top: 6px
}

.sumdisc {
    font-size: 10.5px;
    color: var(--mut);
    line-height: 1.5;
    margin-top: 6px
}

#sumFoot {
    flex: none;
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    background: #fafbfc
}

#sumFoot .squote {
    flex: 1;
    padding: 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
    cursor: pointer;
    border: 0;
    background: var(--brand);
    color: #fff
}

#sumFoot .sclose {
    flex: none;
    padding: 12px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #d6dbe2;
    background: #fff;
    color: #3c4657
}

#quoteWrap {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .5);
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#quoteWrap.open {
    display: flex;
}

#quoteCard {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
    font-family: inherit
}

#quoteCard .qbody {
    padding: 32px 34px 20px
}

#quoteCard .qx {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 18px;
    color: #98a2b3;
    cursor: pointer;
    line-height: 1
}

#quoteCard .qtitle {
    margin: 0 0 10px;
    font-size: 23px;
    font-weight: 800;
    color: #101f36
}

#quoteCard .qsub {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
    color: #667085
}

#quoteCard .qsub b {
    color: #101f36
}

#quoteCard .qgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px
}

#quoteCard .qf {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px
}

#quoteCard label {
    font-size: 13px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 6px
}

#quoteCard input,
#quoteCard textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #101f36;
    background: #fff
}

#quoteCard input::placeholder,
#quoteCard textarea::placeholder {
    color: #98a2b3
}

#quoteCard textarea {
    min-height: 74px;
    resize: vertical
}

#quoteCard .qsearch {
    position: relative
}

#quoteCard .qsearch svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: #98a2b3;
    fill: none;
    stroke-width: 2
}

#quoteCard .qsearch input {
    padding-left: 34px
}

#quoteFoot {
    display: flex;
    justify-content: flex-end;
    padding: 16px 34px;
    background: #faf1f1;
    border-top: 1px solid #f0e2e2;
    border-radius: 0 0 14px 14px
}

#quoteSave {
    background: #c62828;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 30px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .3px;
    cursor: pointer
}

#quoteSave:hover {
    background: #b71c1c
}

@media(max-width:560px) {
    #quoteCard .qgrid {
        grid-template-columns: 1fr
    }
}

/* ---------------- Mobile / responsive ----------------
On phones the fixed 396px sidebar can't sit beside the 3D, so the rail
becomes a bottom sheet that starts collapsed (only its handle + price peek
above the fold) and slides up when tapped; the 3D fills the whole screen.
The toolbar moves to the top so the sheet never covers it. Touch orbit +
pinch-zoom in the 3D are handled by the engine's camera touch script. */
#railgrab {
    display: none
}

@media (max-width:820px) {
    #stage {
        inset: 0
    }

    #toolbar {
        top: 8px;
        bottom: auto;
        left: 8px;
        right: 8px;
        transform: none;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    #toolbar .tb {
        min-width: 52px;
        min-height: 40px
    }

    #rail {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 82vh;
        max-height: 82vh;
        border-left: 0;
        border-top: 1px solid #dde1e7;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -6px 26px rgba(16, 24, 40, .22);
        transform: translateY(calc(100% - 62px));
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
        z-index: 20;
    }

    body.sheet-open #rail {
        transform: translateY(0)
    }

    #railgrab {
        display: block;
        height: 20px;
        flex: none;
        cursor: pointer;
        position: relative
    }

    #railgrab::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 8px;
        transform: translateX(-50%);
        width: 44px;
        height: 5px;
        border-radius: 3px;
        background: #c3cbd5
    }

    #railhead {
        padding: 2px 16px 8px;
        cursor: pointer
    }

    /* fatter tap targets on touch */
    .oprow .add,
    .stp button,
    select,
    .chip,
    .ltab {
        min-height: 38px
    }

    .swatches i {
        width: 28px;
        height: 28px
    }

    .sec>.head {
        padding: 15px 14px
    }
}

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

    #rail {
        height: 86vh;
        max-height: 86vh
    }

    #railhead .price {
        font-size: 17px
    }
}
#screenshot-container {
    display: none;
}

/* Responsive application shell */
html,
body {
    width: 100%;
    min-width: 0;
    height: 100%;
    height: 100dvh;
    overscroll-behavior: none;
}

button,
select,
input,
textarea {
    touch-action: manipulation;
}

#stage,
#rail,
#sections,
#sumBody {
    min-width: 0;
    min-height: 0;
}

#pricingPanel {
    padding: 0 16px 8px;
    flex: none;
}

#priceStatus {
    display: block;
    color: #667085;
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#priceBreakdown {
    max-height: 118px;
    margin-top: 5px;
    overflow-y: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
}

#priceBreakdown:empty {
    display: none;
}

#priceBreakdown > div {
    padding: 5px 7px !important;
    font-size: 10px !important;
}

.overlay2 {
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background-color: #1f2a3a;
    background-image: linear-gradient(180deg, rgba(20, 28, 44, .35) 0%, rgba(20, 28, 44, .55) 100%), url('/images/intro-bg.jpg'), linear-gradient(180deg, #f2b46a 0%, #d9865a 28%, #6e7d8a 46%, #3d6a3a 58%, #244b2a 100%);
    background-size: cover, cover, cover;
    background-position: center, center, center;
    background-repeat: no-repeat;
}

.overlay2 .inner-div h1 {
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.2;
    font-weight: 700;
    margin: 12px 0 2px;
}

.overlay2 .inner-div > p:not(.footer-text) {
    margin: 0 0 14px;
    font-size: 15px;
}

.overlay2 .footer-text {
    margin: 22px calc(-1 * clamp(20px, 5vw, 36px)) calc(-1 * clamp(20px, 5vw, 36px));
    padding: 14px clamp(20px, 5vw, 36px);
    background: #f4f5f8;
    border-top: 1px solid #e6e9ef;
    border-radius: 0 0 18px 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}

.overlay2 .footer-text strong {
    color: var(--brand);
    font-weight: 700;
}

.overlay2 .inner-div {
    width: min(100%, 460px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: clamp(20px, 5vw, 36px);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
    text-align: center;
}

.overlay2 .logo {
    width: clamp(82px, 22vw, 130px);
    height: auto;
}

.overlay2 .state-select {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 12px 0;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #fff;
}

.overlay2 .form-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 16px 0;
    text-align: left;
}

.overlay2 .form-check-input {
    flex: none;
    width: 20px;
    height: 20px;
}

.overlay2 .design-btn {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
}

.overlay2 .design-btn.disabled {
    opacity: .45;
    pointer-events: none;
}

.modal {
    padding: 12px !important;
}

.modal-dialog {
    width: min(100%, 500px);
    margin: min(5vh, 36px) auto;
}

.modal-content {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

@media (min-width: 821px) and (max-width: 1180px) {
    #stage {
        right: 340px;
    }

    #rail {
        width: 340px;
    }

    #railhead {
        padding-inline: 12px;
    }

    #sections {
        padding-inline: 9px;
    }

    .sec > .head {
        padding: 12px 11px;
    }

    #toolbar {
        max-width: calc(100vw - 370px);
        overflow-x: auto;
        scrollbar-width: thin;
    }

    #toolbar .tb {
        min-width: 52px;
        padding-inline: 7px;
    }
}

@media (max-width: 820px) {
    body {
        position: fixed;
        inset: 0;
    }

    #stage {
        height: 100dvh;
    }

    #stage.mobile-preview {
        position: fixed;
        inset: 12px 12px auto auto;
        width: 150px;
        height: 150px;
        overflow: hidden;
        border: 2px solid rgba(255, 255, 255, .95);
        border-radius: 12px;
        background: #101f36;
        box-shadow: 0 8px 28px rgba(16, 24, 40, .38);
        z-index: 40;
        touch-action: none;
    }

    #stage.mobile-preview.is-dragging {
        box-shadow: 0 12px 34px rgba(16, 24, 40, .48);
    }

    #stage.mobile-preview iframe {
        display: block;
        height: 100%;
        pointer-events: auto;
    }

    #stage.mobile-preview #toolbar {
        display: none;
    }

    #stage.mobile-preview .drag-tab {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 100%;
        height: 28px;
        padding: 0 7px;
        border: 0;
        border-radius: 9px 9px 0 0;
        background: rgba(16, 31, 54, .88);
        color: #fff;
        font: 700 10px/1 system-ui, 'Segoe UI', Arial, sans-serif;
        cursor: grab;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
    }

    #stage.mobile-preview.is-dragging .drag-tab {
        cursor: grabbing;
    }

    #toolbar {
        max-width: calc(100vw - 16px);
        padding: 3px;
        padding-top: max(3px, env(safe-area-inset-top));
        scrollbar-width: none;
    }

    #toolbar::-webkit-scrollbar {
        display: none;
    }

    #toolbar .tb {
        flex: 0 0 auto;
        min-width: 54px;
        min-height: 44px;
        padding: 5px 8px;
    }

    #rail {
        height: min(84dvh, 760px);
        max-height: calc(100dvh - 58px);
        padding-bottom: env(safe-area-inset-bottom);
        transform: translateY(calc(100% - 70px - env(safe-area-inset-bottom)));
        will-change: transform;
    }

    body.sheet-open {
        touch-action: none;
    }

    body.sheet-open #rail {
        touch-action: auto;
    }

    #railgrab {
        min-height: 22px;
    }

    #railhead {
        min-height: 48px;
        padding: 0 14px 7px;
    }

    #railhead .logo img {
        width: 58px;
        height: 42px;
        object-fit: contain;
    }

    #pricingPanel {
        padding: 0 14px 7px;
    }

    #priceBreakdown {
        max-height: 96px;
    }

    #wallpill {
        margin-inline: 12px;
        flex: none;
        overflow-wrap: anywhere;
    }

    #sections {
        padding: 2px 10px 10px;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    #cta {
        flex: none;
        padding: 8px 10px max(10px, env(safe-area-inset-bottom));
        background: var(--bg);
    }

    #cta button,
    .oprow .add,
    .stp button,
    select,
    .chip,
    .ltab {
        min-height: 37px;
    }

    #sumWrap,
    #quoteWrap {
        align-items: flex-end;
        padding: 0;
    }

    #sumCard,
    #quoteCard {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - env(safe-area-inset-top));
        border-radius: 18px 18px 0 0;
    }

    #sumBody,
    #quoteCard {
        -webkit-overflow-scrolling: touch;
    }

    #sumFoot,
    #quoteFoot {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 600px) {
    #toolbar .tb {
        min-width: 46px;
        padding-inline: 6px;
    }

    #toolbar .tb span {
        display: none;
    }

    #toolbar .tb svg {
        width: 22px;
        height: 22px;
    }

    #toolbar .div {
        margin-block: 5px;
    }

    #sumHead {
        padding: 13px 14px 10px;
    }

    #sumBody {
        padding: 4px 14px 12px;
    }

    .srow {
        align-items: flex-start;
        gap: 5px;
        padding-block: 7px;
    }

    .srow .k {
        width: 43%;
        overflow-wrap: anywhere;
    }

    .srow .w {
        justify-content: flex-end;
        text-align: right;
        overflow-wrap: anywhere;
    }

    #sumFoot {
        padding-inline: 12px;
    }

    #quoteCard .qbody {
        padding: 28px 18px 14px;
    }

    #quoteCard .qgrid {
        gap: 0;
    }

    #quoteFoot {
        padding: 12px 18px;
    }

    #requsebtn {
        width: 100%;
        min-height: 46px;
    }
}

@media (max-width: 420px) {
    #rail {
        height: 90dvh;
    }

    #railhead .price {
        font-size: 16px;
    }

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

    .sec > .head {
        gap: 8px;
        padding: 13px 11px;
    }

    .sec > .body {
        padding-inline: 10px;
    }

    #sumFoot {
        flex-direction: column-reverse;
    }

    #sumFoot .sclose,
    #sumFoot .squote {
        width: 100%;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    #toolbar {
        right: auto;
        width: min(58vw, 460px);
    }

    #rail {
        left: auto;
        top: 0;
        right: 0;
        width: min(48vw, 390px);
        height: 100dvh;
        max-height: none;
        border-radius: 16px 0 0 16px;
        transform: translateX(calc(100% - 62px));
    }

    body.sheet-open #rail {
        transform: translateX(0);
    }

    #railgrab {
        position: absolute;
        left: 0;
        top: 50%;
        width: 22px;
        height: 58px;
        transform: translate(-100%, -50%);
        border-radius: 10px 0 0 10px;
        background: var(--bg);
        box-shadow: -3px 0 10px rgba(16, 24, 40, .16);
    }

    #railgrab::before {
        left: 8px;
        top: 50%;
        width: 5px;
        height: 34px;
        transform: translateY(-50%);
    }

    #railhead {
        padding-top: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #rail {
        transition: none;
    }
}

/*===================== Compare Model CSS =====================*/
#compareWrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(16, 24, 40, 0.55);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    justify-content: flex-start; /* Slides in from left */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: system-ui, 'Segoe UI', Arial, sans-serif;
}
#compareWrap.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Modal Container - Compact by Default */
.compare-container {
    display: flex;
    width: auto;
    max-width: 450px; /* Compact width when detail breakdown is collapsed */
    height: 100vh;
    background: var(--card, #ffffff);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s ease;
    position: relative;
    overflow: hidden;
}

#compareWrap.open .compare-container {
    transform: translateX(0);
}

/* Expanded State on Hover or Card Click */
.compare-container.has-active-panel {
    max-width: 1120px;
    width: 92vw;
}

/* Left Panel: Manufacturer Selection Cards */
.compare-left-panel {
    width: 440px;
    min-width: 340px;
    flex-shrink: 0;
    background: var(--card, #ffffff);
    border-right: 1px solid var(--line, #e5e8ed);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.compare-header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--nav, #233c8e);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.compare-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--mut, #8a919c);
    cursor: pointer;
    line-height: 1;
}
.compare-close-btn:hover { color: var(--brand, #c62828); }

.compare-subtext {
    font-size: 0.82rem;
    color: var(--mut, #8a919c);
    margin-bottom: 16px;
    line-height: 1.45;
    font-weight: 600;
}

/* Building Specs Bar */
.compare-specs-bar {
    background: var(--bg, #eceff3);
    border: 1px solid var(--line, #e5e8ed);
    border-radius: 10px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    text-align: center;
}
.compare-specs-item span {
    display: block;
    color: var(--mut, #8a919c);
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
}
.compare-specs-item strong {
    color: var(--ink, #20242a);
    font-size: 0.88rem;
    font-weight: 800;
}

/* Manufacturer Cards */
.mfg-compare-card {
    border: 1.5px solid var(--line, #e5e8ed);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    background: var(--card, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.mfg-compare-card:hover, .mfg-compare-card.active {
    border-color: var(--brand, #c62828);
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.1);
}
.mfg-compare-card.best-price {
    border-color: var(--ok, #1b7f4d) !important;
    background: #f4faf4;
}

.mfg-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.mfg-card-title {
    font-weight: 700;
    color: var(--ink, #20242a);
    font-size: 0.98rem;
    margin-bottom: 4px;
}
.mfg-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}
.badge-current { background: #e5e8ed; color: var(--ink, #20242a); }
.badge-lowest { background: #d9e6d9; color: var(--ok, #1b7f4d); }
.badge-average { background: #fef3c7; color: #b45309; }

.mfg-card-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--brand, #c62828);
    text-align: right;
}
.mfg-card-subprice {
    font-size: 0.72rem;
    color: var(--mut, #8a919c);
    text-align: right;
    font-weight: 600;
}

.mfg-select-box {
    background: var(--bg, #eceff3);
    border: 2px dashed #c3cbd5;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    text-align: center;
}

/* Right Detail Panel - Collapsed by Default */
.compare-right-panel {
    flex: 1;
    background: var(--bg, #eceff3);
    padding: 0;
    width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, padding 0.35s ease;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

/* Expanded Breakdown Panel */
.compare-container.has-active-panel .compare-right-panel {
    max-width: 660px;
    width: 100%;
    opacity: 1;
    padding: 28px;
    overflow-y: auto;
    pointer-events: auto;
}

.breakdown-notice {
    background: #e8effc;
    border: 1px solid #d2dff5;
    border-radius: 8px;
    padding: 12px 16px;
    color: #23407c;
    font-size: 0.83rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.breakdown-card {
    background: var(--card, #ffffff);
    border: 1px solid var(--line, #e5e8ed);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}
.breakdown-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--nav, #233c8e);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--line, #e5e8ed);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.92rem;
    color: var(--ink, #20242a);
}
.breakdown-row span:first-child {
    color: var(--mut, #8a919c);
    font-weight: 600;
}
.breakdown-row span:last-child {
    font-weight: 700;
}
.breakdown-row.subtotal {
    font-weight: 700;
    border-top: 1px solid var(--line, #e5e8ed);
    border-bottom: 1px solid var(--line, #e5e8ed);
    margin: 8px 0;
    padding: 10px 0;
    font-size: 1.02rem;
    color: var(--ink, #20242a);
}
.breakdown-row.grand-total {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand, #c62828);
    border-top: 2px solid var(--ink, #20242a);
    padding-top: 14px;
    margin-top: 14px;
}
.btn-select-mfg {
    width: 100%;
    background: var(--brand, #c62828);
    color: white;
    font-weight: 800;
    border: none;
    padding: 14px;
    border-radius: 9px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.6px;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(198, 40, 40, 0.35);
}
.btn-select-mfg:hover {
    background: #b71c1c;
}

.mobile-back-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--nav, #233c8e);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 14px;
    cursor: pointer;
    padding: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .compare-container {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
    }

    .compare-left-panel {
        width: 100% !important;
        min-width: 100% !important;
        padding: 16px;
    }

    .compare-right-panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100%;
        max-width: 100% !important;
        z-index: 20;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        background: var(--card, #ffffff);
        padding: 16px !important;
    }

    .compare-container.has-active-panel .compare-right-panel {
        transform: translateX(0);
        opacity: 1;
    }

    .mobile-back-btn {
        display: flex !important;
    }
}

