/* 3D House Builder: uses the --mv-* tokens from merge-v12.css so it follows the light/dark theme */
.bd {
    margin-block: clamp(18px, 3vw, 40px);
    color: var(--mv-ink)
}

.bd-head {
    max-width: 820px;
    margin: 0 auto 26px;
    text-align: center
}

.bd-head h1 {
    margin: 12px 0 10px;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.12;
    color: var(--mv-ink)
}

.bd-head p {
    margin: 0;
    font-size: .98rem;
    color: var(--mv-mute)
}

.bd-grid {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 22px;
    align-items: start
}

.bd-panel {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 18px;
    background: var(--mv-card);
    border: 1px solid var(--mv-line);
    border-radius: 22px;
    scrollbar-width: thin
}

html[data-theme="dark"] .bd-panel {
    background: #0f172a;
    border-color: #1e293b
}

.bd-steps {
    display: flex;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none
}

.bd-steps button {
    display: grid;
    place-items: center;
    flex: 1;
    height: 34px;
    border: 1px solid var(--mv-line);
    border-radius: 10px;
    background: var(--mv-soft);
    color: var(--mv-mute);
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer
}

.bd-steps button.done {
    color: var(--mv-em);
    border-color: var(--mv-pill-bd)
}

.bd-steps button.on {
    background: #064e3b;
    border-color: #064e3b;
    color: #fff
}

.bd-step h2 {
    margin: 0 0 4px;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--mv-ink)
}

.bd-step h3 {
    margin: 16px 0 8px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--mv-mute)
}

.bd-step[hidden] {
    display: none
}

.bd-sub {
    margin: 0 0 12px;
    font-size: .8rem;
    color: var(--mv-mute)
}

.bd-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px
}

.bd-cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

.bd-card {
    display: grid;
    gap: 5px;
    justify-items: center;
    padding: 8px 6px 9px;
    border: 1.5px solid var(--mv-line);
    border-radius: 14px;
    background: var(--mv-soft);
    color: var(--mv-ink);
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, transform .15s
}

.bd-card:hover {
    border-color: #10b981;
    transform: translateY(-2px)
}

.bd-card.on {
    border-color: #10b981;
    background: var(--mv-pill-bg);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .25)
}

.bd-card canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 9px;
    background: rgba(148, 163, 184, .12)
}

.bd-card b {
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2
}

.bd-card small {
    font-size: .66rem;
    color: var(--mv-mute);
    line-height: 1.2
}

.bd-swatches {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 7px
}

.bd-sw {
    aspect-ratio: 1;
    border: 2px solid var(--mv-line);
    border-radius: 50%;
    cursor: pointer;
    padding: 0
}

.bd-sw.on {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .3)
}

.bd-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--mv-mute)
}

.bd-custom input {
    width: 44px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--mv-line);
    border-radius: 8px;
    background: transparent;
    cursor: pointer
}

.bd-tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.bd-tabs button,
.bd-seg button {
    padding: 6px 11px;
    border: 1px solid var(--mv-line);
    border-radius: 999px;
    background: var(--mv-soft);
    color: var(--mv-mute);
    font: inherit;
    font-size: .74rem;
    font-weight: 800;
    cursor: pointer
}

.bd-tabs button[aria-selected="true"],
.bd-seg button[aria-pressed="true"] {
    background: #064e3b;
    border-color: #064e3b;
    color: #fff
}

.bd-seg {
    display: flex;
    gap: 6px;
    margin-bottom: 10px
}

.bd-placed {
    margin-top: 14px
}

.bd-placed h3 span {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 99px;
    background: var(--mv-pill-bg);
    color: var(--mv-em)
}

.bd-placed ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 150px;
    overflow-y: auto
}

.bd-placed li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--mv-line);
    border-radius: 10px;
    background: var(--mv-soft);
    font-size: .76rem;
    font-weight: 700
}

.bd-placed li.on {
    border-color: #10b981
}

.bd-placed li button {
    border: 0;
    background: transparent;
    color: var(--mv-mute);
    cursor: pointer;
    font-size: .78rem
}

.bd-check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-top: 12px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--mv-ink);
    cursor: pointer
}

.bd-check input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #10b981;
    flex: none
}

.bd-check small {
    display: block;
    margin-top: 2px;
    font-weight: 500;
    color: var(--mv-mute)
}

.bd-sea {
    padding: 12px 14px;
    border: 1px solid var(--mv-pill-bd);
    border-radius: 14px;
    background: var(--mv-pill-bg)
}

.bd-drop {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 26px 14px;
    border: 2px dashed var(--mv-line);
    border-radius: 16px;
    background: var(--mv-soft);
    text-align: center;
    cursor: pointer;
    color: var(--mv-mute)
}

.bd-drop.over,
.bd-drop:hover {
    border-color: #10b981
}

.bd-drop .ic {
    font-size: 1.7rem;
    color: var(--mv-em)
}

.bd-drop b {
    color: var(--mv-ink);
    font-size: .86rem
}

.bd-drop small {
    font-size: .72rem
}

.bd-nav {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--mv-line)
}

.bd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 11px 16px;
    border: 1px solid #064e3b;
    border-radius: 12px;
    background: #064e3b;
    color: #fff;
    font: inherit;
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s
}

.bd-btn:hover {
    background: #047857
}

.bd-btn:disabled {
    opacity: .5;
    cursor: wait
}

.bd-btn .ic {
    color: #6ee7b7
}

.bd-btn-ghost {
    background: transparent;
    color: var(--mv-ink);
    border-color: var(--mv-line)
}

.bd-btn-ghost:hover {
    background: var(--mv-soft);
    border-color: #10b981
}

.bd-btn-pdf {
    background: #10b981;
    border-color: #10b981;
    color: #022c22
}

.bd-btn-pdf:hover {
    background: #34d399
}

.bd-btn-pdf .ic {
    color: #022c22
}

.bd-stage {
    min-width: 0
}

.bd-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px
}

.bd-toolbar button {
    padding: 7px 13px;
    border: 1px solid var(--mv-line);
    border-radius: 10px;
    background: var(--mv-card);
    color: var(--mv-ink);
    font: inherit;
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer
}

.bd-toolbar button:hover:not(:disabled) {
    border-color: #10b981
}

.bd-toolbar button:disabled {
    opacity: .45;
    cursor: default
}

html[data-theme="dark"] .bd-toolbar button {
    background: #1e293b;
    border-color: #334155
}

.bd-toolbar-hint {
    margin-left: auto;
    font-size: .76rem;
    color: var(--mv-mute)
}

.bd-view {
    overflow: hidden;
    border: 1px solid var(--mv-line);
    border-radius: 22px;
    background: #dbeafe;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .12)
}

html[data-theme="dark"] .bd-view {
    border-color: #1e293b;
    background: #0b1530;
    box-shadow: none
}

.bd-view canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    cursor: default;
    outline: 0
}

.bd-view canvas:focus-visible {
    box-shadow: inset 0 0 0 3px #10b981
}

.bd-insp {
    margin: 14px 0 0;
    padding: 10px;
    border: 1px solid var(--mv-line);
    border-radius: 18px;
    background: var(--mv-card)
}

.bd-insp img {
    display: block;
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 12px
}

.bd-insp figcaption {
    margin-top: 6px;
    font-size: .74rem;
    font-weight: 700;
    color: var(--mv-mute)
}

.bd-bottom {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin-top: 16px
}

.bd-cost,
.bd-export {
    padding: 18px;
    border: 1px solid var(--mv-line);
    border-radius: 20px;
    background: var(--mv-card)
}

html[data-theme="dark"] .bd-cost,
html[data-theme="dark"] .bd-export {
    background: #0f172a;
    border-color: #1e293b
}

.bd-cost h3,
.bd-export h3 {
    margin: 0 0 12px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--mv-mute)
}

.bd-cost dl {
    display: grid;
    gap: 7px;
    margin: 0
}

.bd-cost dl div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: .8rem;
    color: var(--mv-mute)
}

.bd-cost dd {
    margin: 0;
    font-weight: 800;
    color: var(--mv-ink);
    font-variant-numeric: tabular-nums
}

.bd-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--mv-line)
}

.bd-total span {
    font-weight: 800
}

.bd-total b {
    font-size: 1.5rem;
    color: var(--mv-em);
    font-weight: 900
}

.bd-fine {
    margin: 10px 0 0;
    font-size: .7rem;
    color: var(--mv-dim)
}

.bd-export {
    display: grid;
    gap: 9px;
    align-content: start
}

.bd-export .bd-btn {
    flex: none
}

.bd-link {
    justify-self: start;
    border: 0;
    background: transparent;
    color: var(--mv-mute);
    font: inherit;
    font-size: .76rem;
    text-decoration: underline;
    cursor: pointer
}

.bd-modal {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 6, 23, .72);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px)
}

.bd-modal[hidden] {
    display: none
}

.bd-modal-box {
    position: relative;
    display: grid;
    gap: 12px;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 26px;
    background: var(--mv-card);
    color: var(--mv-ink);
    border: 1px solid var(--mv-line);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(2, 6, 23, .5)
}

html[data-theme="dark"] .bd-modal-box {
    background: #0f172a;
    border-color: #1e293b
}

.bd-modal-box h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    padding-right: 30px
}

.bd-modal-box>p {
    margin: 0;
    font-size: .84rem;
    color: var(--mv-mute)
}

.bd-modal-box label {
    display: grid;
    gap: 5px;
    font-size: .74rem;
    font-weight: 800;
    color: var(--mv-ink)
}

.bd-modal-box label small {
    font-weight: 500;
    color: var(--mv-dim)
}

.bd-modal-box label.bd-check {
    display: flex;
    margin-top: 0
}

.bd-modal-box label.bd-check a {
    color: var(--mv-em)
}

.bd-modal-box input[type=text],
.bd-modal-box input[type=email],
.bd-modal-box input[type=tel] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid var(--mv-line);
    border-radius: 12px;
    background: var(--mv-soft);
    color: var(--mv-ink);
    font: inherit;
    font-size: .88rem
}

.bd-modal-box input:focus {
    outline: 0;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .22)
}

.bd-modal-box input.bad {
    border-color: #ef4444
}

.bd-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.bd-modal-x {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--mv-mute);
    font-size: 1.15rem;
    cursor: pointer
}

.bd-modal-x:hover {
    background: var(--mv-soft)
}

.bd-error {
    margin: 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
    font-size: .8rem;
    font-weight: 700
}

.bd-error[hidden] {
    display: none
}

html[data-theme="dark"] .bd-error {
    color: #f87171
}

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

    .bd-panel {
        position: static;
        max-height: none
    }

    .bd-bottom {
        grid-template-columns: 1fr
    }
}

@media(max-width:560px) {
    .bd-cards-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .bd-swatches {
        grid-template-columns: repeat(6, 1fr)
    }

    .bd-two {
        grid-template-columns: 1fr
    }

    .bd-toolbar-hint {
        margin-left: 0;
        width: 100%
    }
}


.bd-btn[hidden],
.bd-link[hidden],
.bd-insp[hidden] {
    display: none
}