.grid-editor {
    --cell-size: 24px;
    --grid-size: 24;
    display: grid;
    grid-template-columns: repeat(var(--grid-size), var(--cell-size));
    grid-template-rows: repeat(var(--grid-size), var(--cell-size));
    width: calc(var(--grid-size) * var(--cell-size));
    min-width: calc(var(--grid-size) * var(--cell-size));
    border: 1px solid #cbd5e1;
    background: #ffffff;
    user-select: none;
    touch-action: none;
}

#layout-form > .grid,
#layout-form > .grid > section,
#layout-form > .grid > aside {
    min-width: 0;
}

.grid-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    transition: background-color 80ms ease, box-shadow 80ms ease;
}

.grid-cell:hover {
    background: #eff6ff;
}

.grid-cell.selected {
    background: #60a5fa;
    box-shadow: inset 0 0 0 1px #1d4ed8;
}

.grid-cell.preview-add {
    background: #93c5fd;
    box-shadow: inset 0 0 0 2px #2563eb;
}

.grid-cell.preview-erase {
    background: #fecaca;
    box-shadow: inset 0 0 0 2px #dc2626;
}

.preset-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 0.85rem 1rem;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.preset-button:hover,
.preset-button:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.preset-button span {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 700;
}

.preset-button small {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
}

.mode-button,
.speed-button {
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #ffffff;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.mode-button.active,
.speed-button.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.entrance-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.generate-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    gap: 0.65rem;
}

.button-spinner,
.loading-spinner {
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 999px;
    height: 1rem;
    width: 1rem;
    animation: spin 800ms linear infinite;
}

.generate-button.is-loading .button-spinner,
.generation-loading .loading-spinner {
    display: inline-block;
}

.generation-loading .loading-spinner {
    border-color: #dbeafe;
    border-top-color: #2563eb;
    height: 1.4rem;
    width: 1.4rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.generated-plans-section {
    margin-top: 2rem;
    scroll-margin-top: 5rem;
}

.generated-plans-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.generated-plans-heading p {
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.generated-plans-heading h2 {
    color: #020617;
    font-size: 1.65rem;
    font-weight: 750;
    letter-spacing: 0;
    margin-top: 0.25rem;
}

.generated-plans-heading span {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
}

.generation-loading,
.generation-error {
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
}

.generated-plans-section.hidden,
.generation-loading.hidden,
.generation-error.hidden {
    display: none;
}

.generation-loading strong {
    color: #0f172a;
    display: block;
    font-size: 0.95rem;
}

.generation-loading p {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.generation-error {
    border-color: #fecdd3;
    color: #9f1239;
    font-size: 0.9rem;
    font-weight: 700;
}

.plan-card-grid {
    align-items: start;
    display: grid;
    gap: 1.35rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 1rem;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.15rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.plan-card:hover,
.plan-card:focus-visible,
.plan-card.is-active {
    border-color: #93c5fd;
    box-shadow: 0 24px 60px rgba(37, 99, 235, 0.12);
    outline: none;
    transform: translateY(-2px);
}

.plan-card.is-selected {
    border-color: #10b981;
    box-shadow: 0 24px 60px rgba(16, 185, 129, 0.14);
}

.plan-card-header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.plan-card-kicker {
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.plan-card-title {
    color: #020617;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.3;
}

.plan-card-description {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.65;
    margin-top: 0.45rem;
}

.plan-card-badges {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex-shrink: 0;
}

.score-badge,
.rating-badge {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
}

.score-badge {
    background: #eff6ff;
    color: #1d4ed8;
}

.rating-badge {
    background: #f0fdf4;
    color: #047857;
}

.plan-metric-grid {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 0.85rem;
    display: grid;
    gap: 0.65rem 0.9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1rem 0;
    padding: 0.85rem;
}

.plan-metric-grid dt {
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.plan-metric-grid dd {
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 800;
    margin-top: 0.16rem;
}

.plan-preview-frame {
    flex: 1;
    min-height: 0;
    position: relative;
}

.plan-preview {
    min-width: 0;
}

.plan-action-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    position: absolute;
    right: 0.7rem;
    top: 0.7rem;
    z-index: 2;
}

.inspect-plan-button,
.render-plan-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #0f172a;
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 850;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.inspect-plan-button::before {
    content: "+";
    font-size: 1rem;
    line-height: 1;
}

.render-plan-button {
    background: #020617;
    border-color: #020617;
    color: #ffffff;
}

.render-plan-button::before {
    content: "3D";
    font-size: 0.7rem;
    line-height: 1;
}

.inspect-plan-button:hover,
.inspect-plan-button:focus-visible,
.render-plan-button:hover,
.render-plan-button:focus-visible {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
    color: #0f172a;
    outline: none;
    transform: translateY(-1px);
}

.plan-svg {
    display: block;
    overflow: visible;
}

.plan-grid-cell {
    fill: #f8fafc;
    stroke: #e2e8f0;
    stroke-width: 1;
}

.plan-zone-cell {
    opacity: 0.74;
    stroke: #ffffff;
    stroke-width: 1.5;
    transition: opacity 150ms ease;
}

.plan-zone:hover .plan-zone-cell,
.plan-zone:focus .plan-zone-cell {
    opacity: 0.92;
}

.plan-room-shape {
    stroke: #ffffff;
    stroke-width: 3;
    transition: filter 150ms ease, stroke 150ms ease;
}

.plan-room:hover .plan-room-shape,
.plan-room:focus .plan-room-shape {
    filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.18));
    stroke: #2563eb;
}

.plan-label {
    dominant-baseline: middle;
    fill: #0f172a;
    font-size: 10.5px;
    font-weight: 800;
    pointer-events: none;
}

.entrance-label {
    fill: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
}

.zone-label {
    dominant-baseline: middle;
    fill: #334155;
    font-size: 9px;
    font-weight: 800;
    pointer-events: none;
}

.plan-opening-gap {
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-width: 6;
}

.plan-interior-wall {
    stroke: #64748b;
    stroke-linecap: square;
    stroke-width: 1.8;
}

.plan-door-swing {
    stroke: #2563eb;
    stroke-linecap: round;
    stroke-width: 2;
}

.plan-outline {
    stroke: #334155;
    stroke-linecap: square;
    stroke-width: 3;
}

.plan-entrance-dot {
    fill: #2563eb;
    stroke: #ffffff;
    stroke-width: 2;
}

.review-notes {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.9rem;
}

.review-notes p {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.65rem;
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.45;
    padding: 0.62rem 0.7rem;
}

.review-notes span {
    color: #b45309;
    display: block;
    font-size: 0.63rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    margin-bottom: 0.12rem;
    text-transform: uppercase;
}

.plan-copy-block {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    margin-top: 0.9rem;
    padding: 0.85rem;
}

.plan-copy-block.muted {
    background: #f8fafc;
    border-color: #eef2f7;
}

.plan-copy-block h3,
.score-factor-list h3 {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.plan-copy-block li,
.plan-copy-block p {
    color: #475569;
    font-size: 0.83rem;
    line-height: 1.55;
}

.plan-copy-block li + li,
.plan-copy-block p + p {
    margin-top: 0.28rem;
}

.plan-details {
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    margin-top: 0.9rem;
    overflow: hidden;
}

.plan-details summary {
    color: #0f172a;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    list-style-position: inside;
    padding: 0.82rem 0.9rem;
}

.plan-details[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.calculation-list,
.quality-list,
.score-factor-list {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
}

.calculation-list div,
.quality-row,
.score-factor-list p {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 0.65rem;
    display: grid;
    gap: 0.15rem;
    padding: 0.62rem 0.7rem;
}

.calculation-list span,
.quality-row span,
.score-factor-list span {
    color: #334155;
    font-size: 0.76rem;
    font-weight: 800;
}

.calculation-list strong,
.quality-row strong {
    color: #0f172a;
    font-size: 0.86rem;
}

.calculation-list small,
.quality-row small,
.score-factor-list small {
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1.45;
}

.check-status-pass strong,
.check-status-pass span:first-child {
    color: #047857;
}

.check-status-warn strong,
.check-status-warn span:first-child {
    color: #b45309;
}

.check-status-fail strong,
.check-status-fail span:first-child {
    color: #be123c;
}

.select-layout-form {
    margin-top: 1rem;
}

.select-layout-button {
    background: #020617;
    border-radius: 0.75rem;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 0.85rem 1rem;
    transition: background-color 150ms ease, transform 150ms ease;
    width: 100%;
}

.select-layout-button:hover,
.select-layout-button:focus-visible {
    background: #1d4ed8;
    outline: none;
    transform: translateY(-1px);
}

.plan-card.is-selected .select-layout-button {
    background: #047857;
}

.empty-results {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 2.5rem;
    text-align: center;
}

.empty-results h2 {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 800;
}

.empty-results p {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

body.overflow-hidden {
    overflow: hidden;
}

.plan-inspector {
    inset: 0;
    position: fixed;
    z-index: 80;
}

.plan-inspector.hidden {
    display: none;
}

.plan-inspector-backdrop {
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.68);
    inset: 0;
    position: absolute;
}

.plan-inspector-panel {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.2rem;
    box-shadow: 0 34px 110px rgba(15, 23, 42, 0.34);
    display: flex;
    flex-direction: column;
    inset: clamp(0.75rem, 3vw, 2rem);
    min-height: 0;
    overflow: hidden;
    position: absolute;
}

.plan-inspector-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.plan-inspector-heading {
    min-width: 0;
}

.plan-inspector-heading p {
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.plan-inspector-heading h2 {
    color: #020617;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 850;
    letter-spacing: 0;
    margin-top: 0.15rem;
}

.plan-inspector-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 0.75rem;
}

.plan-inspector-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.plan-inspector-close {
    background: #020617;
    border-radius: 0.7rem;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 850;
    padding: 0.65rem 0.85rem;
}

.plan-inspector-close:hover,
.plan-inspector-close:focus-visible {
    background: #1d4ed8;
    outline: none;
}

.plan-inspector-body {
    align-items: start;
    display: grid;
    flex: 1;
    gap: 1.1rem;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    min-height: 0;
    overflow: hidden;
    padding: 1rem;
}

.plan-inspector-preview {
    align-self: start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
    min-height: 0;
    overflow: hidden;
}

.plan-inspector-preview-chrome {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
}

.plan-inspector-preview-chrome span {
    color: #334155;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-inspector-preview-canvas {
    align-items: flex-start;
    background:
        linear-gradient(#eef2f7 1px, transparent 1px),
        linear-gradient(90deg, #eef2f7 1px, transparent 1px),
        #f8fafc;
    background-size: 28px 28px;
    display: flex;
    flex: 1;
    justify-content: center;
    min-height: 0;
    overflow: auto;
    padding: 1.1rem;
}

.plan-inspector-preview-canvas .plan-preview {
    max-width: none;
    min-width: min(760px, 100%);
    width: min(960px, 100%);
}

.plan-inspector-preview-canvas .plan-svg {
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    width: 100%;
}

.plan-inspector-meta {
    display: grid;
    gap: 0.85rem;
    max-height: calc(100vh - 7rem);
    min-width: 0;
    overflow: auto;
    padding-right: 0.2rem;
}

.plan-inspector-section,
.plan-inspector-meta .plan-copy-block,
.plan-inspector-meta .review-notes,
.plan-inspector-meta .plan-details {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.plan-inspector-section h3 {
    border-bottom: 1px solid #eef2f7;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    padding: 0.85rem 0.9rem 0.5rem;
    text-transform: uppercase;
}

.plan-inspector-meta .plan-metric-grid {
    background: transparent;
    border: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0.85rem 0.9rem;
}

.plan-inspector-meta .plan-copy-block,
.plan-inspector-meta .review-notes,
.plan-inspector-meta .plan-details {
    margin-top: 0;
}

.plan-inspector-meta .plan-copy-block {
    padding: 0.9rem;
}

.home-renderer {
    inset: 0;
    position: fixed;
    z-index: 90;
}

.home-renderer.hidden {
    display: none;
}

.home-renderer-backdrop {
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.7);
    inset: 0;
    position: absolute;
}

.home-renderer-panel {
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1.2rem;
    box-shadow: 0 34px 110px rgba(15, 23, 42, 0.34);
    display: flex;
    flex-direction: column;
    inset: clamp(0.75rem, 3vw, 2rem);
    min-height: 0;
    overflow: hidden;
    position: absolute;
}

.home-renderer.is-expanded .home-renderer-panel {
    border-radius: 0;
    inset: 0;
}

.home-renderer.is-expanded .home-render-stage {
    min-height: calc(100vh - 12rem);
}

.home-renderer.is-expanded .home-renderer-body {
    grid-template-columns: minmax(0, 1fr);
}

.home-renderer.is-expanded .home-render-meta {
    display: none;
}

.home-renderer-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.home-renderer-heading {
    min-width: 0;
}

.home-renderer-heading p {
    color: #2563eb;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-renderer-heading h2 {
    color: #020617;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 850;
    letter-spacing: 0;
    margin-top: 0.15rem;
}

.home-renderer-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.home-renderer-badges {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.home-render-mode-toggle,
.home-roof-mode-toggle,
.home-roof-visibility-toggle,
.home-render-palette-toggle {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 0.8rem;
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.2rem;
}

.home-render-mode-toggle button,
.home-roof-mode-toggle button,
.home-roof-visibility-toggle button,
.home-render-palette-toggle button {
    border-radius: 0.62rem;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 850;
    padding: 0.48rem 0.68rem;
    transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.home-render-mode-toggle button.active,
.home-render-mode-toggle button:focus-visible,
.home-roof-mode-toggle button.active,
.home-roof-mode-toggle button:focus-visible,
.home-roof-visibility-toggle button.active,
.home-roof-visibility-toggle button:focus-visible,
.home-render-palette-toggle button.active,
.home-render-palette-toggle button:focus-visible {
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    color: #0f172a;
    outline: none;
}

.home-render-reset,
.home-render-fullscreen,
.home-render-label-toggle,
.home-renderer-close {
    border-radius: 0.7rem;
    font-size: 0.82rem;
    font-weight: 850;
    padding: 0.65rem 0.85rem;
}

.home-render-reset,
.home-render-fullscreen,
.home-render-label-toggle {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.home-render-fullscreen.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.palette-swatch {
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 999px;
    display: inline-block;
    height: 0.62rem;
    margin-right: 0.28rem;
    vertical-align: -0.05rem;
    width: 0.62rem;
}

.palette-swatch.architect { background: #9aaeba; }
.palette-swatch.sage { background: #8fa9a0; }
.palette-swatch.slate { background: #879aaa; }

.home-render-label-toggle.is-active {
    background: #ecfdf5;
    border-color: #86efac;
    color: #047857;
}

.home-renderer-close {
    background: #020617;
    color: #ffffff;
}

.home-render-reset:hover,
.home-render-reset:focus-visible,
.home-render-fullscreen:hover,
.home-render-fullscreen:focus-visible,
.home-render-label-toggle:hover,
.home-render-label-toggle:focus-visible,
.home-renderer-close:hover,
.home-renderer-close:focus-visible {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
    outline: none;
}

.home-renderer-body {
    align-items: stretch;
    display: grid;
    flex: 1;
    gap: 1.1rem;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 350px);
    min-height: 0;
    overflow: hidden;
    padding: 1rem;
}

.home-render-stage-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.home-render-stage-header {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
}

.home-render-stage-header span {
    color: #334155;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-render-stage-header small {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.home-render-stage {
    background:
        radial-gradient(circle at 24% 20%, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(90deg, #e2e8f0 1px, transparent 1px),
        #f8fafc;
    background-size: auto, 32px 32px, 32px 32px, auto;
    flex: 1;
    min-height: 560px;
    overflow: hidden;
    position: relative;
}

.home-render-overlay {
    display: flex;
    gap: 0.65rem;
    left: 0.85rem;
    pointer-events: none;
    position: absolute;
    top: 0.85rem;
    z-index: 2;
}

.view-controller,
.section-controller {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 0.85rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    color: #334155;
    font-size: 0.7rem;
    font-weight: 750;
    padding: 0.55rem;
    pointer-events: auto;
}

.view-controller > span,
.section-controller-heading strong {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.view-controller small,
.section-controller small {
    color: #64748b;
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 0.35rem;
}

.view-controller-ball {
    background:
        radial-gradient(circle at 33% 25%, rgba(255, 255, 255, 0.96) 0 6%, rgba(186, 230, 253, 0.88) 25%, rgba(14, 116, 144, 0.9) 69%, #0c4a6e 100%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: inset -11px -10px 18px rgba(8, 47, 73, 0.42), inset 5px 5px 9px rgba(255, 255, 255, 0.36), 0 7px 16px rgba(15, 23, 42, 0.24);
    cursor: grab;
    height: 5.5rem;
    margin-top: 0.38rem;
    overflow: hidden;
    position: relative;
    touch-action: none;
    width: 5.5rem;
}

.view-controller-ball.is-dragging { cursor: grabbing; }

.trackball-ring {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    display: block;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 50%;
}

.trackball-ring.ring-x { height: 1.9rem; transform: translate(-50%, -50%) rotateX(67deg); width: 4.5rem; }
.trackball-ring.ring-y { height: 4.5rem; transform: translate(-50%, -50%) rotateY(67deg); width: 1.9rem; }
.trackball-dot { background: #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.34); height: 0.45rem; left: 35%; pointer-events: none; position: absolute; top: 29%; width: 0.45rem; }
.view-controller-ball button { background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.75); border-radius: 999px; bottom: 0.42rem; color: #0c4a6e; font-size: 0.58rem; font-weight: 850; left: 50%; padding: 0.16rem 0.35rem; position: absolute; transform: translateX(-50%); }
.view-controller-ball button:hover,
.view-controller-ball button:focus-visible { background: #fff; outline: 2px solid #0ea5e9; }

.section-controller { display: grid; gap: 0.35rem; min-width: 12.4rem; }
.section-controller-heading { align-items: center; display: flex; justify-content: space-between; }
.section-controller-heading button {
    background: #e2e8f0;
    border-radius: 999px;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 850;
    padding: 0.2rem 0.48rem;
}
.section-controller-heading button.is-active { background: #dbeafe; color: #1d4ed8; }
.section-controller label { align-items: center; display: flex; justify-content: space-between; margin-top: 0.15rem; }
.section-controller select { background: #fff; border: 1px solid #cbd5e1; border-radius: 0.42rem; color: #334155; font-size: 0.71rem; padding: 0.28rem; }
.section-controller input { accent-color: #2563eb; width: 100%; }

.appearance-controller {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 0.85rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    max-height: calc(100vh - 12rem);
    overflow: hidden;
    pointer-events: auto;
    width: 8.8rem;
}

.appearance-controller[open] { width: min(27rem, calc(100vw - 18rem)); }

.appearance-controller summary {
    align-items: center;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    font-size: 0.72rem;
    font-weight: 900;
    justify-content: space-between;
    letter-spacing: 0.06em;
    list-style: none;
    padding: 0.72rem 0.78rem;
    text-transform: uppercase;
}

.appearance-controller-body {
    display: grid;
    gap: 0.9rem;
    max-height: calc(100vh - 16rem);
    overflow: auto;
    padding: 0.78rem;
}

.appearance-controller-body section + section { border-top: 1px solid #e2e8f0; padding-top: 0.8rem; }
.appearance-controller-body h3 { color: #0f172a; font-size: 0.74rem; font-weight: 900; }
.appearance-controller-body section > p { color: #64748b; font-size: 0.65rem; margin-top: 0.12rem; }

.appearance-palette-grid {
    display: grid;
    gap: 0.36rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.55rem;
}

.appearance-palette-grid button {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #dbe2ea;
    border-radius: 0.55rem;
    color: #334155;
    display: flex;
    font-size: 0.65rem;
    font-weight: 800;
    gap: 0.42rem;
    min-width: 0;
    padding: 0.38rem 0.42rem;
    text-align: left;
}

.appearance-palette-grid button.active,
.appearance-palette-grid button:focus-visible { background: #eff6ff; border-color: #60a5fa; color: #1d4ed8; outline: none; }

.palette-pair {
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 0.35rem;
    flex: 0 0 auto;
    height: 1.25rem;
    width: 2.2rem;
}

.palette-pair.architect { background: linear-gradient(90deg, #eeeae2 0 50%, #9aaeba 50%); }
.palette-pair.warm-oak { background: linear-gradient(90deg, #f2e6d5 0 50%, #b89470 50%); }
.palette-pair.sage-studio { background: linear-gradient(90deg, #e5eadf 0 50%, #91aa8f 50%); }
.palette-pair.coastal { background: linear-gradient(90deg, #eaf1f1 0 50%, #8fadb7 50%); }
.palette-pair.slate { background: linear-gradient(90deg, #e1e6ea 0 50%, #7d8f9e 50%); }
.palette-pair.soft-clay { background: linear-gradient(90deg, #f0e2da 0 50%, #b7846f 50%); }
.palette-pair.sandstone { background: linear-gradient(90deg, #eee5d2 0 50%, #baa57d 50%); }
.palette-pair.charcoal { background: linear-gradient(90deg, #d9dddf 0 50%, #5f6b73 50%); }
.palette-pair.lavender { background: linear-gradient(90deg, #ece7ef 0 50%, #aaa0b5 50%); }
.palette-pair.monochrome { background: linear-gradient(90deg, #e8e8e5 0 50%, #92979b 50%); }

.custom-palette-row {
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    display: grid;
    gap: 0.42rem;
    grid-template-columns: auto auto 1fr;
    margin-top: 0.55rem;
    padding: 0.5rem;
}

.custom-palette-row label { color: #475569; display: grid; font-size: 0.61rem; font-weight: 800; gap: 0.2rem; }
.custom-palette-row input { background: transparent; border: 0; height: 1.6rem; padding: 0; width: 2.2rem; }
.custom-palette-row button { background: #0f172a; border-radius: 0.45rem; color: #fff; font-size: 0.62rem; font-weight: 850; min-height: 1.8rem; padding: 0.32rem 0.45rem; }
.custom-palette-row button.is-active { background: #047857; }

.exterior-theme-grid { display: grid; gap: 0.38rem; margin-top: 0.5rem; }
.exterior-theme-grid button { background: #f8fafc; border: 1px solid #dbe2ea; border-radius: 0.55rem; display: grid; gap: 0.08rem; padding: 0.45rem 0.5rem; text-align: left; }
.exterior-theme-grid button strong { color: #334155; font-size: 0.67rem; }
.exterior-theme-grid button small { color: #64748b; font-size: 0.59rem; }
.exterior-theme-grid button.active,
.exterior-theme-grid button:focus-visible { background: #f0fdf4; border-color: #4ade80; outline: none; }

.home-render-toolstrip {
    align-items: center;
    background: rgba(248, 250, 252, 0.98);
    border-bottom: 1px solid #dbe3ec;
    display: flex;
    gap: 0.38rem;
    min-height: 3rem;
    padding: 0.42rem 1rem;
    position: relative;
    z-index: 8;
}

.home-render-toolstrip-label {
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    margin-right: 0.18rem;
    text-transform: uppercase;
}

.home-render-toolstrip > small {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: auto;
}

.toolbar-tool {
    position: relative;
    width: auto;
}

.toolbar-tool > summary {
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.55rem;
    color: #334155;
    cursor: pointer;
    display: flex;
    font-size: 0.69rem;
    font-weight: 850;
    gap: 0.6rem;
    justify-content: space-between;
    letter-spacing: 0;
    list-style: none;
    min-height: 2.12rem;
    padding: 0.48rem 0.65rem;
    text-transform: none;
}

.toolbar-tool > summary::-webkit-details-marker { display: none; }
.toolbar-tool > summary::after {
    border-bottom: 1.8px solid currentColor;
    border-right: 1.8px solid currentColor;
    color: #64748b;
    content: "";
    flex: 0 0 auto;
    height: 0.38rem;
    margin-left: 0.15rem;
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform 150ms ease, color 150ms ease;
    width: 0.38rem;
}
.toolbar-tool[open] > summary { background: #eff6ff; border-color: #60a5fa; color: #1d4ed8; }
.toolbar-tool[open] > summary::after { color: #2563eb; transform: rotate(225deg); }

.toolbar-popover {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #cbd5e1;
    border-radius: 0.8rem;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
    left: 0;
    margin-top: 0.42rem;
    max-height: min(68vh, 40rem);
    overflow: auto;
    padding: 0.72rem;
    position: absolute;
    top: 100%;
    z-index: 12;
}

.orbit-popover { min-width: 7.2rem; }
.section-popover { min-width: 15rem; }
.display-popover { min-width: 17rem; }
.display-controller { display: grid; gap: 0.48rem; }
.display-controller > span {
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    margin-top: 0.2rem;
    text-transform: uppercase;
}
.display-controller > span:first-child { margin-top: 0; }
.display-controller .home-roof-mode-toggle,
.display-controller .home-roof-visibility-toggle { width: 100%; }
.display-controller .home-roof-mode-toggle button,
.display-controller .home-roof-visibility-toggle button { flex: 1; }
.display-controller .home-render-label-toggle { justify-self: stretch; }
.toolbar-tool.appearance-controller,
.toolbar-tool.appearance-controller[open] { background: transparent; border: 0; box-shadow: none; max-height: none; overflow: visible; width: auto; }
.toolbar-tool.appearance-controller > summary { padding: 0.48rem 0.65rem; }
.toolbar-tool .appearance-controller-body { display: grid; gap: 0.9rem; left: auto; max-height: min(72vh, 44rem); min-width: 27rem; overflow: auto; padding: 0.78rem; position: absolute; right: 0; top: 100%; width: 27rem; }

.toolbar-popover .view-controller,
.toolbar-popover .section-controller {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.home-render-tooltip {
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 0.45rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
    color: #f8fafc;
    font-size: 0.7rem;
    font-weight: 800;
    opacity: 0;
    padding: 0.38rem 0.5rem;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -100%);
    transition: opacity 100ms ease;
    z-index: 4;
}

.home-render-tooltip.is-visible { opacity: 1; }

.home-renderer-panel:fullscreen {
    border-radius: 0;
    inset: 0;
}

.home-renderer-panel:fullscreen .home-render-stage {
    min-height: calc(100vh - 12rem);
}

.home-renderer-panel:fullscreen .home-renderer-body {
    grid-template-columns: minmax(0, 1fr);
}

.home-renderer-panel:fullscreen .home-render-meta {
    display: none;
}

.home-render-stage canvas {
    display: block;
    height: 100%;
    touch-action: none;
    width: 100%;
}

.home-render-empty,
.home-render-loading,
.home-render-error {
    align-items: center;
    color: #475569;
    display: flex;
    font-size: 0.9rem;
    font-weight: 750;
    inset: 0;
    justify-content: center;
    padding: 2rem;
    position: absolute;
    text-align: center;
}

.home-render-error {
    color: #be123c;
}

.home-render-meta {
    display: grid;
    gap: 0.85rem;
    max-height: calc(100vh - 7rem);
    min-width: 0;
    overflow: auto;
    padding-right: 0.2rem;
}

.home-render-meta .plan-metric-grid,
.home-render-meta .plan-copy-block,
.home-render-meta .review-notes {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
    margin-top: 0;
}

.home-render-meta .plan-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .grid-editor {
        --cell-size: 20px;
    }

    .generated-plans-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .plan-card-grid {
        grid-template-columns: 1fr;
    }

    .plan-card-header {
        flex-direction: column;
    }

    .plan-card-badges {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

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

    .plan-inspector-panel {
        border-radius: 0;
        inset: 0;
    }

    .plan-inspector-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .plan-inspector-actions {
        align-items: flex-start;
        justify-content: space-between;
        width: 100%;
    }

    .plan-inspector-badges {
        justify-content: flex-start;
    }

    .plan-inspector-body {
        grid-template-columns: 1fr;
        overflow: auto;
        padding: 0.8rem;
    }

    .plan-inspector-preview,
    .plan-inspector-meta {
        max-height: none;
    }

    .plan-inspector-preview-canvas .plan-preview {
        min-width: 620px;
    }

    .home-renderer-panel {
        border-radius: 0;
        inset: 0;
    }

    .home-renderer-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-renderer-actions {
        align-items: flex-start;
        flex-wrap: wrap;
        justify-content: space-between;
        width: 100%;
    }

    .home-renderer-badges {
        justify-content: flex-start;
    }

    .home-renderer-body {
        grid-template-columns: 1fr;
        overflow: auto;
        padding: 0.8rem;
    }

    .home-render-stage {
        min-height: 460px;
    }

    .home-render-toolstrip {
        flex-wrap: wrap;
        padding: 0.45rem 0.55rem;
    }

    .home-render-toolstrip > small {
        display: none;
    }

    .home-render-toolstrip-label {
        flex-basis: 100%;
    }

    .home-render-toolstrip .toolbar-tool {
        position: static;
    }

    .home-render-toolstrip .toolbar-popover,
    .toolbar-tool .appearance-controller-body {
        left: 0.55rem;
        min-width: 0;
        right: 0.55rem;
        width: auto;
    }

    .toolbar-popover.section-popover {
        min-width: 0;
    }

    .toolbar-popover.display-popover {
        min-width: 0;
    }

    .home-render-overlay {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.4rem;
        left: 0.55rem;
        top: 0.55rem;
    }

    .section-controller {
        min-width: 10.5rem;
    }

    .appearance-controller[open] {
        max-height: 58vh;
        width: min(25rem, calc(100vw - 1.1rem));
    }

    .home-render-meta {
        max-height: none;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    .plan-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Modern application shell and focused creation flow */
:root {
    color-scheme: light;
    --vm-ink: #0a1428;
    --vm-muted: #607089;
    --vm-line: #d9e2ee;
    --vm-blue: #2563eb;
    --vm-cyan: #22d3ee;
    --vm-surface: rgba(255, 255, 255, 0.94);
}

.app-body {
    background:
        radial-gradient(circle at 12% 4%, rgba(37, 99, 235, 0.1), transparent 26rem),
        radial-gradient(circle at 90% 20%, rgba(34, 211, 238, 0.08), transparent 28rem),
        #eef3f8;
    color: var(--vm-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
    backdrop-filter: blur(18px);
    background: rgba(7, 17, 36, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 34px rgba(2, 8, 23, 0.14);
}

.app-nav { min-height: 4.85rem; }

.app-brand {
    align-items: center;
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    padding: 0.38rem 0;
    text-decoration: none;
}

.app-brand-logo-surface {
    align-items: center;
    background: linear-gradient(145deg, rgba(255,255,255,.99), rgba(244,247,251,.96));
    border: 1px solid rgba(255,255,255,.7);
    border-radius: .85rem;
    box-shadow: 0 10px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.9);
    display: inline-flex;
    justify-content: center;
    padding: .28rem .5rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.app-brand-logo {
    display: block;
    height: auto;
    max-width: 100%;
    width: clamp(8.75rem, 13vw, 10.75rem);
}

.app-brand:hover .app-brand-logo-surface,
.app-brand:focus-visible .app-brand-logo-surface {
    border-color: rgba(255,143,79,.92);
    box-shadow: 0 13px 32px rgba(0,0,0,.3), 0 0 0 3px rgba(242,111,42,.18);
    transform: translateY(-1px);
}

.app-brand:focus-visible { outline: none; }

.app-nav-action,
.landing-primary-action {
    align-items: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 1px solid rgba(147, 197, 253, 0.42);
    border-radius: 0.72rem;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.25);
    color: #fff;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.55rem;
    justify-content: center;
    padding: 0.7rem 1rem;
    text-decoration: none;
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.app-nav-action:hover,
.app-nav-action:focus-visible,
.landing-primary-action:hover,
.landing-primary-action:focus-visible {
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.36);
    outline: none;
    transform: translateY(-1px);
}

.landing-hero {
    background:
        radial-gradient(circle at 10% 5%, rgba(37, 99, 235, 0.45), transparent 32rem),
        radial-gradient(circle at 94% 88%, rgba(34, 211, 238, 0.13), transparent 28rem),
        #071124;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 2rem;
    box-shadow: 0 32px 90px rgba(2, 8, 23, 0.24);
    display: grid;
    gap: clamp(2rem, 5vw, 5rem);
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
    margin: 2rem auto 0;
    max-width: 80rem;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.7rem);
    position: relative;
}

.landing-hero::after {
    background-image: linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
    background-size: 42px 42px;
    content: "";
    inset: 0;
    mask-image: linear-gradient(90deg, #000, transparent 58%);
    pointer-events: none;
    position: absolute;
}

.landing-hero-copy { align-self: center; position: relative; z-index: 1; }
.landing-eyebrow,
.planner-eyebrow {
    color: #38bdf8;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.landing-hero h1 {
    color: #fff;
    font-size: clamp(2.45rem, 5vw, 4.8rem);
    font-weight: 850;
    letter-spacing: -0.065em;
    line-height: 0.98;
    margin-top: 1rem;
}
.landing-hero h1 span { color: #7dd3fc; }
.landing-hero-copy > p:not(.landing-eyebrow) { color: #b5c2d6; font-size: 1rem; line-height: 1.75; margin-top: 1.45rem; max-width: 35rem; }
.landing-primary-action { margin-top: 1.8rem; padding: 0.9rem 1.2rem; }

.landing-steps { align-items: center; display: flex; gap: 1.2rem; margin-top: 2rem; }
.landing-steps span { color: #93a4bd; font-size: 0.72rem; font-weight: 750; }
.landing-steps b { color: #67e8f9; margin-right: 0.28rem; }

.landing-preview-shell {
    align-self: center;
    backdrop-filter: blur(14px);
    background: rgba(248, 250, 252, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 1.35rem;
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.28);
    min-width: 0;
    padding: 1rem;
    position: relative;
    transform: perspective(1100px) rotateY(-3deg) rotateX(2deg);
    z-index: 1;
}

.landing-preview-header,
.landing-preview-footer { align-items: center; display: flex; justify-content: space-between; }
.landing-preview-header { border-bottom: 1px solid #e2e8f0; padding: 0.25rem 0.2rem 0.9rem; }
.landing-preview-header p { color: #0f172a; font-size: 0.76rem; font-weight: 850; }
.landing-preview-header span,
.landing-preview-footer span { color: #718096; font-size: 0.64rem; font-weight: 700; }
.landing-preview-header i { background: #22c55e; border: 4px solid #dcfce7; border-radius: 50%; height: 0.8rem; width: 0.8rem; }

.landing-plan-grid {
    background-color: #f8fafc;
    background-image: linear-gradient(#e8edf4 1px, transparent 1px), linear-gradient(90deg, #e8edf4 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid #dce4ee;
    border-radius: 0.85rem;
    display: grid;
    gap: 0.22rem;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(5, 3rem);
    margin-top: 1rem;
    overflow: hidden;
    padding: 0.55rem;
}
.landing-room { align-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 0.3rem; color: #172033; display: flex; font-size: 0.62rem; font-weight: 850; justify-content: center; }
.landing-room.entry { background: #bae6fd; grid-column: 3 / 5; grid-row: 4 / 6; }
.landing-room.living { background: #c7d2fe; grid-column: 1 / 4; grid-row: 1 / 4; }
.landing-room.kitchen { background: #fde68a; grid-column: 4 / 8; grid-row: 1 / 3; }
.landing-room.bath { background: #a7f3d0; grid-column: 5 / 7; grid-row: 3 / 5; }
.landing-room.bedroom { background: #fecdd3; grid-column: 1 / 3; grid-row: 4 / 6; }
.landing-room.storage { background: #ddd6fe; grid-column: 7 / 8; grid-row: 3 / 6; writing-mode: vertical-rl; }
.landing-preview-footer { padding: 0.9rem 0.25rem 0.1rem; }

.landing-value-strip {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, 1fr);
    margin: 1.2rem auto 3rem;
    max-width: 80rem;
}
.landing-value-strip > div { background: rgba(255,255,255,.8); border: 1px solid var(--vm-line); border-radius: 1rem; display: grid; gap: 0.3rem; padding: 1.2rem; }
.landing-value-strip span { color: var(--vm-blue); font-size: 0.67rem; font-weight: 900; letter-spacing: 0.12em; }
.landing-value-strip strong { color: #0f172a; font-size: 0.9rem; }
.landing-value-strip p { color: var(--vm-muted); font-size: 0.78rem; line-height: 1.55; }

.planner-intro h1,
.page-heading h1 { color: #071124; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 850; letter-spacing: -0.05em; line-height: 1.05; margin-top: 0.55rem; }
.planner-intro > div > p:last-child,
.page-heading > div > p:last-child { color: var(--vm-muted); font-size: 0.9rem; line-height: 1.65; margin-top: 0.75rem; max-width: 42rem; }
.planner-eyebrow { color: #1d4ed8; }

.workflow-stepper { background: rgba(255,255,255,.78); border: 1px solid var(--vm-line); border-radius: 0.9rem; box-shadow: 0 12px 32px rgba(15,23,42,.06); }
.workflow-stepper > div { align-items: center; display: flex; gap: 0.45rem; justify-content: center; min-width: 7.2rem; }
.workflow-stepper b { align-items: center; border: 1px solid currentColor; border-radius: 50%; display: inline-flex; font-size: 0.62rem; height: 1.15rem; justify-content: center; opacity: .8; width: 1.15rem; }

.workspace-card,
.setup-panel {
    backdrop-filter: blur(12px);
    background: var(--vm-surface);
    border-color: rgba(203, 213, 225, 0.95) !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.07) !important;
}
.workspace-card { border-radius: 1.35rem !important; }
.setup-panel { border-radius: 1.15rem !important; transition: opacity 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.setup-panel:not(.opacity-50) { box-shadow: 0 22px 54px rgba(37,99,235,.1) !important; }

#layout-form input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
#layout-form select { border-color: #cbd5e1; border-radius: 0.7rem; min-height: 2.65rem; }
#layout-form input:focus,
#layout-form select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); outline: none; }

.entrance-option { min-height: 3.1rem; position: relative; }
.entrance-option:has(input:checked)::after { color: #2563eb; content: "✓"; font-size: 0.9rem; font-weight: 900; position: absolute; right: 1rem; top: 0.85rem; }

.preference-advanced { border: 1px solid #dbe3ee; border-radius: 0.85rem; overflow: hidden; }
.preference-advanced summary { color: #334155; cursor: pointer; font-size: 0.8rem; font-weight: 800; list-style: none; padding: 0.8rem 0.9rem; position: relative; }
.preference-advanced summary::-webkit-details-marker { display: none; }
.preference-advanced summary::after { color: #2563eb; content: "+"; font-size: 1rem; position: absolute; right: 0.9rem; top: 0.65rem; }
.preference-advanced[open] summary::after { content: "−"; }
.preference-advanced-body { border-top: 1px solid #e2e8f0; display: grid; padding: 0.9rem; }
.preference-advanced-body > p { color: #64748b; font-size: 0.72rem; line-height: 1.5; margin-bottom: 0.8rem; }

.generate-button { background: linear-gradient(135deg, #0f172a, #1e3a5f) !important; border-radius: 0.8rem !important; min-height: 3rem; }
.generate-button:not(:disabled):hover { box-shadow: 0 14px 30px rgba(15,23,42,.2); transform: translateY(-1px); }

.generated-plans-section { margin-top: 2.8rem; }
.generated-plans-heading h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 850; letter-spacing: -0.04em; }

.generation-loading-list { display: grid; gap: 1rem; margin-bottom: 1rem; }
.generation-loading-list.hidden { display: none; }
.generation-loading-list .loading-spinner { border-color: rgba(37,99,235,.18); border-top-color: #2563eb; display: inline-block; height: 1.35rem; width: 1.35rem; }
.generation-loading-row { align-items: center; background: rgba(255,255,255,.94); border: 1px solid #dbe4f0; border-radius: 1.1rem; box-shadow: 0 18px 45px rgba(15,23,42,.06); display: grid; gap: 1.2rem; grid-template-columns: auto minmax(180px,.65fr) minmax(260px,1fr); min-height: 8.5rem; overflow: hidden; padding: 1rem 1.2rem; position: relative; }
.generation-loading-row::after { animation: loading-shimmer 1.5s ease-in-out infinite; background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent); content: ""; inset: 0; position: absolute; transform: translateX(-100%); }
.loading-row-icon { align-items: center; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 50%; display: flex; height: 3rem; justify-content: center; width: 3rem; }
.loading-row-copy { display: grid; gap: .32rem; }
.loading-row-copy strong { color: #0f172a; font-size: .9rem; }
.loading-row-copy span { color: #64748b; font-size: .75rem; }
.loading-row-copy i { background: #e7edf5; border-radius: 1rem; display: block; height: .45rem; margin-top: .3rem; width: 100%; }
.loading-row-copy i:last-child { width: 64%; }
.loading-row-preview { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: .8rem; display: grid; gap: .2rem; grid-template-columns: 1.2fr .8fr 1fr; grid-template-rows: repeat(2, 2.35rem); padding: .4rem; }
.loading-row-preview b { background: #dce6f1; border-radius: .24rem; }
.loading-row-preview b:first-child { grid-row: 1 / 3; }
.loading-row-preview b:last-child { grid-column: 2 / 4; }
@keyframes loading-shimmer { 100% { transform: translateX(100%); } }

.plan-card-grid { display: grid; gap: 1.15rem; grid-template-columns: 1fr; }
.plan-card { border-radius: 1.2rem; box-shadow: 0 18px 50px rgba(15,23,42,.07); padding: 1.25rem; }
.plan-card:hover,
.plan-card:focus-visible,
.plan-card.is-active { transform: none; }
.plan-card-row { align-items: start; display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .65fr); margin-top: 1rem; }
.plan-card-visual { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: .95rem; min-width: 0; overflow: hidden; padding: .75rem; }
.plan-card-summary { min-width: 0; }
.plan-card-summary .plan-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; }
.plan-card-summary .review-notes { margin-top: .75rem; }
.plan-card-summary .select-layout-form { margin-top: .85rem; }
.plan-card-summary .plan-details { margin-top: .75rem; }
.plan-preview-frame { min-height: 20rem; }
.plan-preview-frame .plan-preview { height: 100%; }
.plan-preview-frame .plan-svg { height: auto; max-height: 34rem; width: 100%; }

.plan-details summary { list-style: none; padding-right: 2.3rem; position: relative; }
.plan-details summary::-webkit-details-marker { display: none; }
.plan-details summary::after { color: #2563eb; content: "+"; font-size: 1rem; position: absolute; right: .9rem; top: .68rem; }
.plan-details[open] summary::after { content: "−"; }
.plan-details-content { background: #f8fafc; display: grid; max-height: 32rem; overflow: auto; }
.plan-details-content .plan-copy-block { background: #fff; margin: .8rem .9rem 0; }
.code-review-block { border-top: 1px solid #e2e8f0; padding: .9rem; }
.code-review-block > h3 { color: #475569; font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.code-review-block > p { color: #64748b; font-size: .72rem; line-height: 1.5; margin-top: .4rem; }

.empty-results { border-radius: 1.2rem; }

.page-shell { min-height: calc(100vh - 4.35rem); }
.page-heading { align-items: end; }
.page-primary-action {
    background: #0f172a;
    border-radius: .75rem;
    box-shadow: 0 12px 28px rgba(15,23,42,.16);
    color: #fff;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 800;
    justify-content: center;
    padding: .78rem 1rem;
    text-decoration: none;
    transition: background-color 150ms ease, transform 150ms ease;
}
.page-primary-action:hover,
.page-primary-action:focus-visible { background: #1d4ed8; outline: none; transform: translateY(-1px); }
.page-shell > .rounded-2xl,
.page-shell > .grid > .rounded-2xl,
.page-shell > .grid > section,
.page-shell > .grid > aside > section {
    border-color: #d7e1ec;
    box-shadow: 0 18px 46px rgba(15,23,42,.07);
}

@media (max-width: 980px) {
    .landing-hero { grid-template-columns: 1fr; margin-left: 1rem; margin-right: 1rem; }
    .landing-preview-shell { transform: none; }
    .landing-value-strip { margin-left: 1rem; margin-right: 1rem; }
    .plan-card-row { grid-template-columns: 1fr; }
    .plan-preview-frame { min-height: 16rem; }
}

@media (max-width: 640px) {
    .app-brand-logo { width: 8.75rem; }
    .app-nav-action { padding: .65rem .78rem; }
    .landing-hero { border-radius: 1.3rem; padding: 1.6rem; }
    .landing-hero h1 { font-size: 2.45rem; }
    .landing-steps { gap: .7rem; }
    .landing-plan-grid { grid-template-rows: repeat(5, 2.3rem); }
    .landing-value-strip { grid-template-columns: 1fr; }
    .workflow-stepper { width: 100%; }
    .workflow-stepper > div { min-width: 0; padding-left: .5rem; padding-right: .5rem; }
    .generation-loading-row { grid-template-columns: auto 1fr; min-height: 7.5rem; }
    .loading-row-preview { display: none; }
    .plan-card { padding: 1rem; }
    .plan-preview-frame { min-height: 13rem; }
}

/* 2026 guided planner and orange / charcoal visual system */
:root {
    --vm-orange: #f26f2a;
    --vm-orange-bright: #ff8a3d;
    --vm-orange-soft: #ffd4bc;
    --vm-charcoal: #0f172a;
    --vm-panel-dark: rgba(15, 23, 42, 0.82);
    --vm-ink: #111318;
    --vm-muted: #69707d;
    --vm-blue: #f26f2a;
    --vm-cyan: #ff9b61;
}

.app-body {
    background:
        radial-gradient(circle at 8% 8%, rgba(242, 111, 42, 0.2), transparent 31rem),
        radial-gradient(circle at 88% 24%, rgba(255, 166, 112, 0.12), transparent 27rem),
        linear-gradient(145deg, #090c12 0%, #121927 48%, #21140f 100%);
    background-attachment: fixed;
}

.app-header {
    background: rgba(8, 11, 17, 0.9);
    border-bottom-color: rgba(242, 111, 42, 0.24);
}

.app-brand-mark {
    background: linear-gradient(145deg, #ff9a5e, #f26f2a);
    box-shadow: 0 8px 28px rgba(242, 111, 42, 0.3);
    color: #160b06;
}

.app-brand-copy small { color: #cbb8ae; }

.app-nav-action,
.landing-primary-action {
    background: linear-gradient(135deg, #ff8847, #f26f2a 58%, #d85115);
    border-color: rgba(255, 206, 178, 0.45);
    box-shadow: 0 10px 28px rgba(242, 111, 42, 0.3);
}

.app-nav-action:hover,
.app-nav-action:focus-visible,
.landing-primary-action:hover,
.landing-primary-action:focus-visible {
    box-shadow: 0 16px 38px rgba(242, 111, 42, 0.42);
}

.landing-hero {
    background:
        radial-gradient(circle at 12% 8%, rgba(242, 111, 42, 0.48), transparent 31rem),
        radial-gradient(circle at 94% 88%, rgba(255, 148, 86, 0.14), transparent 28rem),
        linear-gradient(145deg, #0b0e14, #131b29 58%, #28150c);
    border-color: rgba(242, 111, 42, 0.27);
}

.landing-eyebrow,
.planner-eyebrow,
.landing-hero h1 span,
.landing-steps b,
.landing-value-strip span { color: var(--vm-orange-bright); }

.landing-value-strip > div {
    background: rgba(255, 250, 247, 0.94);
    border-color: rgba(242, 111, 42, 0.18);
}

.page-heading h1,
.page-heading > div > p:last-child { color: #fff7f2; }

.page-primary-action,
.select-layout-button,
.plan-action-button {
    background: linear-gradient(135deg, #ff8847, #f26f2a) !important;
}

.guided-planner {
    isolation: isolate;
    min-height: calc(100vh - 4.35rem);
    overflow: hidden;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 5rem;
    position: relative;
}
.guided-planner:has(.generated-plans-section:not(.hidden)) { height: auto; min-height: calc(100dvh - 4.35rem); overflow: visible; }

.guided-planner::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    content: "";
    inset: 0;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
    pointer-events: none;
    position: absolute;
    z-index: -2;
}

.planner-ambient {
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.75;
    pointer-events: none;
    position: absolute;
    z-index: -1;
}

.ambient-one {
    animation: ambient-drift-one 14s ease-in-out infinite alternate;
    background: radial-gradient(circle, rgba(242, 111, 42, 0.28), rgba(242, 111, 42, 0));
    height: 38rem;
    left: -13rem;
    top: 6rem;
    width: 38rem;
}

.ambient-two {
    animation: ambient-drift-two 17s ease-in-out infinite alternate;
    background: radial-gradient(circle, rgba(255, 164, 104, 0.18), rgba(255, 164, 104, 0));
    height: 32rem;
    right: -9rem;
    top: 18rem;
    width: 32rem;
}

@keyframes ambient-drift-one {
    to { transform: translate3d(7rem, 4rem, 0) scale(1.1); }
}

@keyframes ambient-drift-two {
    to { transform: translate3d(-6rem, -5rem, 0) scale(0.86); }
}

.wizard-topbar {
    align-items: center;
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(8rem, 1fr) minmax(18rem, 34rem) minmax(8rem, 1fr);
    margin: 0 auto;
    max-width: 76rem;
    min-height: 4.3rem;
}

.wizard-back {
    align-items: center;
    background: transparent;
    border: 0;
    color: #f6e9e1;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.5rem;
    justify-self: start;
    padding: 0.65rem 0;
    transition: color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.wizard-back:hover { color: var(--vm-orange-bright); transform: translateX(-3px); }
.wizard-back.is-hidden { opacity: 0; pointer-events: none; }
.wizard-save-note { color: #8f99a8; font-size: 0.7rem; font-weight: 650; justify-self: end; }

.wizard-progress-copy { align-items: center; display: flex; justify-content: space-between; margin-bottom: 0.55rem; }
.wizard-progress-copy span { color: #b6bdc8; font-size: 0.68rem; font-weight: 750; }
.wizard-progress-copy strong { color: #fff4ec; font-size: 0.7rem; font-weight: 800; }
.wizard-progress-track { background: rgba(255, 255, 255, 0.1); border-radius: 999px; height: 3px; overflow: hidden; }
.wizard-progress-track i { background: linear-gradient(90deg, #f26f2a, #ffb183); border-radius: inherit; display: block; height: 100%; transition: width 420ms cubic-bezier(.22,.8,.28,1); width: 11.11%; }

.wizard-stage {
    align-items: flex-start;
    display: grid;
    margin: 0 auto;
    max-width: 76rem;
    min-height: 42rem;
    padding: clamp(2.2rem, 7vh, 5.2rem) 0 2rem;
    scroll-margin-top: 5rem;
}

.wizard-panel {
    align-self: start;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 44%),
        var(--vm-panel-dark);
    border: 1px solid rgba(255, 168, 115, 0.17);
    border-radius: 1.75rem;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.3);
    display: none;
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    max-width: 63rem;
    overflow: hidden;
    padding: clamp(1.5rem, 4vw, 3.3rem);
    position: relative;
    width: 100%;
}

.wizard-panel::after {
    background: linear-gradient(90deg, transparent, rgba(242, 111, 42, 0.7), transparent);
    content: "";
    height: 1px;
    left: 10%;
    position: absolute;
    right: 10%;
    top: 0;
}

.wizard-panel.is-active {
    animation: question-rise 620ms cubic-bezier(.2,.82,.25,1) both;
    display: flex;
    flex-direction: column;
}

.wizard-panel.is-active.is-reverse { animation-name: question-return; }
.wizard-panel-wide { max-width: 76rem; }

@keyframes question-rise {
    from { opacity: 0; transform: translateY(88px) scale(0.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes question-return {
    from { opacity: 0; transform: translateY(-42px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.question-heading { margin: 0 auto clamp(1.8rem, 4vw, 2.7rem); max-width: 48rem; text-align: center; }
.question-heading.compact { margin-bottom: 1.5rem; }
.question-heading p { color: var(--vm-orange-bright); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.question-heading h1,
.question-heading h2 { color: #fffaf6; font-size: clamp(1.75rem, 4vw, 3.2rem); font-weight: 850; letter-spacing: -0.045em; line-height: 1.08; margin-top: 0.65rem; }
.question-heading span { color: #adb5c2; display: block; font-size: clamp(0.84rem, 1.5vw, 1rem); line-height: 1.65; margin-top: 0.85rem; }

.choice-grid { display: grid; gap: 1rem; margin: 0 auto; width: 100%; }
.shape-choice-grid,
.use-choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.entrance-choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bedroom-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 46rem; }
.binary-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 39rem; }

.visual-choice {
    align-items: center;
    background: rgba(7, 11, 18, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 1.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 13rem;
    padding: 1.25rem 0.8rem 1rem;
    position: relative;
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.visual-choice:hover,
.visual-choice:focus-within { border-color: rgba(242, 111, 42, 0.66); transform: translateY(-4px); }
.visual-choice:has(input:checked) { background: linear-gradient(145deg, rgba(242, 111, 42, 0.2), rgba(13, 18, 27, 0.68)); border-color: var(--vm-orange); box-shadow: 0 18px 45px rgba(242, 111, 42, 0.16), inset 0 0 0 1px rgba(255, 186, 145, 0.16); transform: translateY(-4px); }
.visual-choice:has(input:checked)::after { align-items: center; background: var(--vm-orange); border-radius: 50%; color: #fff; content: "\2713"; display: flex; font-size: 0.66rem; font-weight: 900; height: 1.35rem; justify-content: center; position: absolute; right: 0.8rem; top: 0.8rem; width: 1.35rem; }
.visual-choice strong { color: #fff7f2; font-size: 0.93rem; font-weight: 850; margin-top: 1rem; }
.visual-choice small { color: #9099a7; font-size: 0.69rem; font-weight: 650; line-height: 1.45; margin-top: 0.28rem; }

.shape-icon { display: block; height: 6.2rem; position: relative; width: 7.2rem; }
.shape-icon i { background: linear-gradient(145deg, rgba(255, 145, 82, 0.26), rgba(242, 111, 42, 0.08)); border: 2px solid #f26f2a; box-shadow: inset 0 0 0 7px rgba(242, 111, 42, 0.05); display: block; position: absolute; }
.shape-icon b { background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 10px 10px; inset: 0.55rem; opacity: 0.7; position: absolute; }
.rectangle-icon i { height: 4.25rem; left: 0.2rem; top: 1rem; width: 6.8rem; }
.square-icon i { height: 5.2rem; left: 1rem; top: 0.5rem; width: 5.2rem; }
.c-shape-icon i { border-right: 0; height: 5.2rem; left: 0.8rem; top: 0.5rem; width: 5.7rem; }
.c-shape-icon i::after { background: #111827; content: ""; height: 2.3rem; position: absolute; right: -0.15rem; top: 1.25rem; width: 3.2rem; }
.irregular-icon i { clip-path: polygon(0 0, 73% 0, 73% 28%, 100% 28%, 100% 100%, 30% 100%, 30% 72%, 0 72%); height: 5.25rem; left: 0.55rem; top: 0.5rem; width: 6.2rem; }

.entrance-icon,
.use-icon { display: block; height: 6.2rem; position: relative; width: 7.2rem; }
.entrance-icon i { border: 2px solid #f26f2a; height: 4.7rem; left: 1.05rem; position: absolute; top: 0.7rem; width: 5.1rem; }
.entrance-icon b { background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 10px 10px; inset: 0.9rem 1.25rem; position: absolute; }
.entrance-icon em { background: #ffac7d; border: 2px solid #f26f2a; bottom: 0.55rem; height: 1.25rem; left: 2.85rem; position: absolute; width: 1.5rem; }
.entrance-north .entrance-icon em { bottom: auto; top: 0.05rem; }
.entrance-west .entrance-icon em { bottom: auto; left: 0.45rem; top: 2.55rem; transform: rotate(90deg); }
.entrance-east .entrance-icon em { bottom: auto; left: auto; right: 0.45rem; top: 2.55rem; transform: rotate(90deg); }

.use-icon i { border: 2px solid #f26f2a; bottom: 0.6rem; height: 3.9rem; left: 1rem; position: absolute; width: 5.2rem; }
.use-icon b { border-bottom: 2px solid #f26f2a; border-left: 2px solid #f26f2a; height: 3.7rem; left: 1.75rem; position: absolute; top: 0.25rem; transform: rotate(-45deg); width: 3.7rem; }
.use-icon em { background: #f26f2a; bottom: 0.6rem; height: 1.9rem; left: 3rem; position: absolute; width: 1.15rem; }
.use-office .use-icon i { border-radius: 0.2rem; height: 4.8rem; }
.use-office .use-icon b { border: 0; border-top: 2px solid #f26f2a; height: 1px; left: 1rem; top: 2.2rem; transform: none; width: 5.2rem; }
.use-office .use-icon em { height: 0.55rem; left: 1.5rem; top: 1.15rem; width: 0.55rem; }
.use-workshop_living .use-icon b { transform: rotate(-35deg); }

.number-icon { align-items: center; border: 2px solid #f26f2a; border-radius: 1.2rem; color: #ff9b61; display: flex; font-size: 2.7rem; font-weight: 900; height: 6.1rem; justify-content: center; width: 6.1rem; }
.storage-icon { border: 2px solid #f26f2a; display: block; height: 5.5rem; margin-top: 0.35rem; position: relative; width: 6.5rem; }
.storage-icon i,
.storage-icon b { background: rgba(242,111,42,.25); border: 1px solid #f26f2a; bottom: 0.7rem; height: 2rem; position: absolute; width: 2rem; }
.storage-icon i { left: 0.65rem; }
.storage-icon b { right: 0.65rem; }
.storage-icon.no::after { background: #ffb087; content: ""; height: 2px; left: 0.45rem; position: absolute; top: 2.6rem; transform: rotate(-38deg); width: 5.55rem; }

.dimension-layout { align-items: center; display: grid; gap: clamp(2rem, 7vw, 5rem); grid-template-columns: minmax(15rem, .9fr) minmax(18rem, 1.1fr); margin: 0 auto; max-width: 52rem; width: 100%; }
.dimension-controls { display: grid; gap: 1.65rem; }
.dimension-control { display: grid; gap: 0.75rem; }
.dimension-control.is-hidden { display: none; }
.dimension-control > span { align-items: center; display: flex; justify-content: space-between; }
.dimension-control strong { color: #f9eee8; font-size: 0.82rem; }
.dimension-control output { color: #ff9b61; font-size: 1rem; font-weight: 850; }
.dimension-note { border-top: 1px solid rgba(255,255,255,.1); color: #9fa8b5; font-size: 0.75rem; padding-top: 1rem; }

.dimension-preview { align-items: center; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 18px 18px; border: 1px solid rgba(255,255,255,.08); border-radius: 1rem; display: flex; height: 18rem; justify-content: center; overflow: hidden; }
.preview-shape { --preview-ratio: 1.25; background: linear-gradient(145deg, rgba(242,111,42,.28), rgba(242,111,42,.08)); border: 2px solid #f26f2a; height: calc(8.5rem / max(var(--preview-ratio), 1)); max-height: 11.5rem; max-width: 15rem; min-height: 6.6rem; min-width: 7rem; position: relative; width: calc(8.5rem * var(--preview-ratio)); }
.preview-shape.square { height: 9.5rem; width: 9.5rem; }
.preview-shape.c_shape { border-right: 0; height: 10rem; width: 13rem; }
.preview-shape.c_shape::after { background: #121a28; content: ""; height: 4.4rem; position: absolute; right: -0.15rem; top: 2.65rem; width: 7.4rem; }
.preview-shape i,
.preview-shape b { color: #ffb087; font-size: .66rem; font-style: normal; font-weight: 800; position: absolute; z-index: 1; }
.preview-shape i { left: 50%; top: -1.5rem; transform: translateX(-50%); }
.preview-shape b { right: -2.4rem; top: 50%; transform: translateY(-50%) rotate(90deg); }

input[type="range"] { accent-color: var(--vm-orange); }
.dimension-control input[type="range"],
.range-question input[type="range"] { appearance: none; background: linear-gradient(90deg, #f26f2a, #ffb086); border-radius: 999px; height: 5px; width: 100%; }
.dimension-control input[type="range"]::-webkit-slider-thumb,
.range-question input[type="range"]::-webkit-slider-thumb { appearance: none; background: #fff7f2; border: 4px solid #f26f2a; border-radius: 50%; box-shadow: 0 5px 18px rgba(242,111,42,.35); height: 1.4rem; width: 1.4rem; }

.wizard-continue,
.wizard-generate { align-items: center; align-self: center; background: linear-gradient(135deg, #ff8847, #f26f2a 62%, #d95419) !important; border: 1px solid rgba(255,205,175,.3); border-radius: 0.85rem; box-shadow: 0 14px 32px rgba(242,111,42,.23); color: #fff; display: inline-flex; font-size: 0.84rem; font-weight: 850; gap: .65rem; justify-content: center; margin-top: 2.25rem; min-height: 3.25rem; padding: .85rem 1.3rem; transition: box-shadow 180ms ease, transform 180ms ease; }
.wizard-continue:hover,
.wizard-generate:hover { box-shadow: 0 18px 40px rgba(242,111,42,.35); transform: translateY(-2px); }

.grid-workbench { margin: 0 auto; max-width: 66rem; width: 100%; }
.grid-toolbar { align-items: center; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: .8rem; }
.grid-toolbar > div:first-child { display: grid; }
.grid-toolbar strong { color: #fff4ed; font-size: .8rem; }
.grid-toolbar small { color: #9ca6b3; font-size: .68rem; }
.grid-tool-group { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.grid-tool-group button { border-radius: .55rem; font-size: .68rem; font-weight: 800; min-height: 2.15rem; padding: .45rem .7rem; }
.grid-clear { background: transparent; border: 1px solid rgba(255,255,255,.16); color: #d4d8df; }
.mode-button,
.speed-button { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.13); color: #d6dae0; }
.mode-button.active,
.speed-button.active { background: rgba(242,111,42,.2); border-color: #f26f2a; color: #ffb087; }
.preset-row { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: .7rem; }
.preset-button { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.12); padding: .65rem .8rem; }
.preset-button:hover,
.preset-button:focus-visible { border-color: #f26f2a; box-shadow: 0 10px 25px rgba(242,111,42,.13); }
.preset-button span { color: #fff1e9; font-size: .75rem; }
.preset-button small { color: #909aa7; font-size: .65rem; }
.tool-hint { background: rgba(242,111,42,.1); border: 1px solid rgba(242,111,42,.16); border-radius: .65rem; color: #ffc2a0; font-size: .7rem; margin-bottom: .7rem; padding: .55rem .7rem; }
.grid-scroll { background: #111827; border: 1px solid rgba(242,111,42,.2); border-radius: .9rem; display: flex; justify-content: center; overflow: auto; padding: .75rem; }
.grid-editor { border-color: #374151; }
.grid-cell:hover { background: #fff0e7; }
.grid-cell.selected { background: #f26f2a; box-shadow: inset 0 0 0 1px #b8400b; }
.grid-cell.preview-add { background: #ff9b61; box-shadow: inset 0 0 0 2px #d84f13; }
.grid-confirm-row { align-items: center; display: flex; justify-content: space-between; }
.grid-confirm-row > p { color: #ffad91; font-size: .75rem; font-weight: 750; }
.grid-confirm-row .wizard-continue { margin-left: auto; margin-top: 1rem; }

.range-question { align-items: center; display: flex; flex-direction: column; margin: 0 auto; max-width: 38rem; width: 100%; }
.range-value { color: #fff8f4; font-size: 2.45rem; font-weight: 900; letter-spacing: -.04em; margin: 1.3rem 0 1rem; }
.range-value small { color: #ff9b61; font-size: 1rem; }
.range-question > input { width: 100%; }
.range-bounds { color: #8e98a6; display: flex; font-size: .68rem; font-weight: 700; justify-content: space-between; margin-top: .6rem; width: 100%; }
.range-question > p { color: #9099a7; font-size: .68rem; margin-top: 1rem; }
.height-visual { border: 2px solid rgba(255,255,255,.15); height: 9rem; overflow: hidden; position: relative; width: 7.5rem; }
.height-visual span { background: linear-gradient(180deg, #ff9b61, rgba(242,111,42,.3)); bottom: 0; left: 0; position: absolute; right: 0; transition: height 250ms ease; }
.height-visual i,
.height-visual b { background: #172033; bottom: 0; height: 3.3rem; position: absolute; width: 1.6rem; }
.height-visual i { left: 1rem; }
.height-visual b { right: 1rem; }
.roof-visual { height: 8.5rem; position: relative; width: 16rem; }
.roof-visual i,
.roof-visual b { background: linear-gradient(90deg, #f26f2a, #ffad78); height: .28rem; position: absolute; top: 4rem; transition: transform 250ms ease; width: 7.8rem; }
.roof-visual i { left: .4rem; transform-origin: right center; }
.roof-visual b { right: .4rem; transform-origin: left center; }
.roof-visual em { border-bottom: 2px solid rgba(255,255,255,.15); border-left: 2px solid rgba(255,255,255,.15); border-right: 2px solid rgba(255,255,255,.15); bottom: .1rem; height: 4rem; left: 1.1rem; position: absolute; right: 1.1rem; }

.wizard-summary { display: grid; gap: .55rem; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 0 auto 1rem; max-width: 55rem; width: 100%; }
.wizard-summary > div { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1); border-radius: .8rem; display: grid; gap: .3rem; padding: .8rem; }
.wizard-summary span { color: #8f99a7; font-size: .62rem; font-weight: 750; text-transform: uppercase; }
.wizard-summary strong { color: #fff2eb; font-size: .78rem; font-weight: 850; }
.wizard-panel .preference-advanced { align-self: center; border-color: rgba(255,255,255,.12); margin-top: .5rem; max-width: 55rem; width: 100%; }
.wizard-panel .preference-advanced summary { color: #d9dce1; }
.wizard-panel .preference-advanced summary::after { color: #f26f2a; }
.wizard-panel .preference-advanced-body { background: rgba(5,8,13,.35); border-top-color: rgba(255,255,255,.1); gap: .75rem; }
.wizard-panel .preference-advanced-body label { display: grid; gap: .3rem; }
.wizard-panel .preference-advanced-body label > span { color: #c2c7cf; font-size: .68rem; font-weight: 750; }
.wizard-panel .preference-advanced-body input,
.wizard-panel .preference-advanced-body select { background: #fff; border: 1px solid #d3d6db; border-radius: .55rem; min-height: 2.5rem; padding: .55rem .7rem; }
.optional-context-grid { display: grid; gap: .6rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.wizard-generate { margin-bottom: 0; min-width: 13rem; }
.concept-note { align-self: center; color: #777f8b; font-size: .62rem; margin-top: .8rem; }

.guided-planner .generated-plans-section { margin: 1rem auto 0; max-width: 76rem; }
.guided-planner .generated-plans-heading h2 { color: #fff5ef; }
.guided-planner .generated-plans-heading p { color: #ff9b61; }
.guided-planner .generated-plans-heading span { background: rgba(15,23,42,.82); border-color: rgba(242,111,42,.23); color: #ffc2a0; }
.guided-planner .generation-loading-row { border-color: rgba(242,111,42,.22); }
.guided-planner .loading-row-icon { background: #fff0e8; border-color: #ffd5bf; }
.guided-planner .generation-loading-list .loading-spinner { border-color: rgba(242,111,42,.2); border-top-color: #f26f2a; }

/* Carry the same accent language through saved plans, inspection, and 3D tools. */
.plan-card:hover,
.plan-card:focus-visible,
.plan-card.is-active { border-color: #ffad7c; box-shadow: 0 22px 55px rgba(242,111,42,.12); }
.plan-card-kicker,
.plan-inspector-heading p,
.home-renderer-heading p { color: #e85f20; }
.score-badge { background: #fff0e7; border-color: #ffd1b7; color: #c84b12; }
.plan-room:hover .plan-room-shape,
.plan-room:focus .plan-room-shape { stroke: #f26f2a; }
.entrance-label { fill: #d95419; }
.plan-door-swing { stroke: #f26f2a; }
.plan-entrance-dot { fill: #f26f2a; }
.plan-details summary::after,
.preference-advanced summary::after { color: #f26f2a; }
.inspect-plan-button:hover,
.inspect-plan-button:focus-visible,
.render-plan-button:hover,
.render-plan-button:focus-visible { border-color: #f26f2a; color: #d95419; }
.home-render-mode-toggle button.active,
.home-roof-mode-toggle button.active,
.home-roof-visibility-toggle button.active,
.section-controller-heading button.is-active { background: #fff0e7; border-color: #ffc49f; color: #c94c13; }
.section-controller input { accent-color: #f26f2a; }
.toolbar-tool[open] > summary,
.appearance-palette-grid button.active,
.appearance-palette-grid button:focus-visible { background: #fff0e7; border-color: #f26f2a; color: #c94c13; }
.toolbar-tool[open] > summary::after { color: #f26f2a; }
.page-primary-action:hover,
.page-primary-action:focus-visible { background: #d95419; }

@media (max-width: 900px) {
    .wizard-topbar { grid-template-columns: auto 1fr; }
    .wizard-save-note { display: none; }
    .shape-choice-grid,
    .use-choice-grid,
    .entrance-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dimension-layout { grid-template-columns: 1fr; }
    .dimension-preview { height: 15rem; }
    .wizard-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
    .guided-planner { padding-left: .75rem; padding-right: .75rem; }
    .wizard-topbar { gap: .7rem; }
    .wizard-back { font-size: .72rem; }
    .wizard-progress-copy strong { display: none; }
    .wizard-stage { min-height: 36rem; padding-top: 2rem; }
    .wizard-panel { border-radius: 1.2rem; padding: 1.25rem; }
    .shape-choice-grid,
    .use-choice-grid,
    .entrance-choice-grid { gap: .65rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
    .visual-choice { min-height: 11.4rem; padding-left: .35rem; padding-right: .35rem; }
    .shape-icon,
    .entrance-icon,
    .use-icon { transform: scale(.84); }
    .bedroom-choice-grid { grid-template-columns: 1fr; }
    .bedroom-choice-grid .visual-choice { min-height: 7rem; }
    .number-icon { height: 3.5rem; width: 3.5rem; }
    .binary-choice-grid { grid-template-columns: 1fr; }
    .binary-choice-grid .visual-choice { min-height: 10rem; }
    .grid-toolbar { align-items: flex-start; flex-direction: column; }
    .grid-tool-group { justify-content: flex-start; }
    .preset-row { grid-template-columns: 1fr; }
    .wizard-summary { grid-template-columns: 1fr 1fr; }
    .optional-context-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .planner-ambient,
    .wizard-panel.is-active { animation: none; }
    .wizard-progress-track i { transition: none; }
    * { scroll-behavior: auto !important; }
}

/* Persistent navigation and a clearer completion signal. */
.guided-planner .wizard-topbar {
    backdrop-filter: blur(18px);
    background: rgba(10,15,24,.88);
    border: 1px solid rgba(242,111,42,.22);
    border-radius: 1rem;
    box-shadow: 0 14px 38px rgba(0,0,0,.24);
    min-height: 4.65rem;
    padding: .65rem .85rem;
    position: sticky;
    top: 5rem;
    z-index: 30;
}
.guided-planner .wizard-back {
    background: rgba(242,111,42,.1);
    border: 1px solid rgba(242,111,42,.38);
    border-radius: .7rem;
    color: #ffd5be;
    min-height: 2.65rem;
    padding: .6rem .85rem;
}
.guided-planner .wizard-back:hover { background: #f26f2a; color: #fff; transform: translateX(-3px); }
.guided-planner .wizard-back.is-hidden { visibility: hidden; }
.guided-planner .wizard-progress-track { height: 5px; }
.guided-planner .wizard-progress-track i { box-shadow: 0 0 18px rgba(242,111,42,.48); overflow: hidden; position: relative; }
.guided-planner .wizard-progress-track i::after { animation: progress-sheen 1.8s ease-in-out infinite; background: linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent); content: ""; inset: 0; position: absolute; transform: translateX(-110%); }
.wizard-progress-percent { color: #ffb58b; font-size: .7rem; font-weight: 900; justify-self: end; letter-spacing: .04em; text-transform: uppercase; }

/* The same model turns while its XY drawing folds into the XZ building. */
.building-transition-model.is-changing-view svg { animation: model-view-turn 860ms cubic-bezier(.2,.78,.2,1) both; transform-origin: center; }
.building-transition-model.is-changing-view { box-shadow: 0 28px 72px rgba(0,0,0,.36), 0 0 0 1px rgba(242,111,42,.24), inset 0 0 55px rgba(242,111,42,.08); }
.live-plan-layer,
.live-elevation-layer { transition-duration: 700ms; }

/* Final viewport overrides intentionally follow the model's base rules. */
.guided-planner { height: calc(100dvh - 4.35rem - 1px); }
.wizard-stage { height: calc(100dvh - 9.9rem - 1px); min-height: 0; }
.wizard-panel,
.wizard-panel-wide,
.model-question-panel { box-sizing: border-box; height: 100%; max-height: 100%; max-width: 76rem; min-height: 0; }
.building-transition-model { margin-right: clamp(2rem,6vw,6rem); margin-top: clamp(10.5rem,19vh,13rem); width: min(27rem,45%); }
.dimension-controls .number-stepper,
.model-question-controls .number-stepper,
.bedroom-number-layout .number-stepper { display: grid; grid-template-columns: 3.15rem minmax(8rem,1fr) 3.15rem; justify-content: normal; }

@media (max-width: 760px) {
    .guided-planner .wizard-topbar { top: auto; }
    .wizard-stage { height: calc(100dvh - 9rem - 1px); }
    .wizard-panel,
    .wizard-panel-wide,
    .model-question-panel { min-height: 0; }
    .model-question-panel .model-question-controls { max-width: none; width: 100%; }
    .building-transition-model { justify-self: center; margin-right: 0; margin-top: 18.5rem; width: calc(100% - 2rem); }
    .model-question-panel > .wizard-continue { align-self: center; margin-left: 0; margin-top: 16rem; }
}

/* Compact, viewport-contained wizard and consistent field components. */
.guided-planner {
    height: calc(100dvh - 4.35rem);
    min-height: 0;
    padding: .6rem clamp(.7rem,2vw,1.5rem) .75rem;
}
.guided-planner .wizard-topbar { max-width: 76rem; min-height: 4.35rem; padding: .55rem .8rem; position: relative; top: auto; }
.wizard-stage { height: calc(100dvh - 9.9rem); min-height: 0; padding: .7rem 0 0; }
.wizard-panel,
.wizard-panel-wide { height: 100%; max-height: 100%; max-width: 76rem; min-height: 0; padding: clamp(1rem,2.3vw,2rem); }
.model-question-panel { min-height: 0; }
.question-heading { margin-bottom: clamp(.75rem,2vh,1.4rem); }
.question-heading h1,
.question-heading h2 { font-size: clamp(1.6rem,3.2vw,2.65rem); margin-top: .35rem; }
.question-heading span { line-height: 1.45; margin-top: .45rem; }
.model-question-panel .question-heading { margin-bottom: .8rem; }
.model-question-panel .model-question-controls { margin-top: 0; max-width: 22rem; }
.building-transition-model { margin-right: clamp(2rem,6vw,6rem); margin-top: clamp(10.5rem,19vh,13rem); width: min(27rem,45%); }
.model-question-panel > .wizard-continue { margin-top: 1.25rem; }
.wizard-continue,
.wizard-generate { margin-top: 1.25rem; min-height: 3rem; }
.visual-choice { min-height: clamp(9.5rem,25vh,12rem); padding: .8rem .65rem; }
.visual-choice strong { margin-top: .45rem; }
.grid-scroll { max-height: min(42vh,22rem); }

.dimension-controls .number-stepper,
.model-question-controls .number-stepper,
.bedroom-number-layout .number-stepper { grid-template-columns: 3.15rem minmax(8rem,1fr) 3.15rem; width: 100%; }
.dimension-controls .number-stepper > button,
.model-question-controls .number-stepper > button,
.bedroom-number-layout .number-stepper > button { border-radius: .75rem; min-height: 3.5rem; width: 100%; }
.dimension-controls .number-input-shell,
.model-question-controls .number-input-shell,
.bedroom-number-layout .number-input-shell { min-height: 3.5rem; }
.dimension-controls .number-input-shell input,
.model-question-controls .number-input-shell input,
.bedroom-number-layout .number-input-shell input { font-size: 1.2rem; min-height: 3.5rem; }
.dimension-control > span:first-child output { display: none; }
.dimension-controls { gap: 1rem; }
.dimension-note { padding-top: .65rem; }

.slope-shell { gap: 0; justify-content: center; padding: 0 1rem; }
.slope-prefix { color: #111827; flex: 0 0 auto; font-size: 1.4rem; font-weight: 950; letter-spacing: -.05em; }
.slope-shell input { flex: 0 0 2.2ch; font-size: 1.4rem !important; padding: 0 !important; text-align: left; width: 2.2ch !important; }
.slope-stepper .number-input-shell:focus-within .slope-prefix { color: #d95519; }

/* Purpose illustrations: meaningful objects with restrained hover motion. */
.use-illustration {
    align-items: center;
    background: radial-gradient(circle at 50% 38%,rgba(242,111,42,.2),rgba(242,111,42,.035) 68%);
    border: 1px solid rgba(242,111,42,.24);
    border-radius: 1rem;
    display: flex;
    height: clamp(5rem,14vh,6.2rem);
    justify-content: center;
    overflow: hidden;
    transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease, transform 320ms cubic-bezier(.2,.8,.2,1);
    width: 8.5rem;
}
.use-illustration svg { height: 88%; transition: transform 380ms cubic-bezier(.2,.8,.2,1); width: 88%; }
.visual-choice:hover .use-illustration,
.visual-choice:has(input:checked) .use-illustration { background: radial-gradient(circle at 50% 38%,rgba(242,111,42,.34),rgba(242,111,42,.07) 70%); border-color: #f26f2a; box-shadow: 0 12px 30px rgba(242,111,42,.17); transform: translateY(-3px); }
.visual-choice:hover .use-illustration svg { transform: scale(1.055); }
.use-building { fill: rgba(242,111,42,.16); stroke-width: 3; }
.use-detail { stroke: #ffd0b5; stroke-width: 2.4; }
.use-ground { opacity: .72; }
.use-home:hover .use-detail,
.use-home:has(input:checked) .use-detail { animation: home-light 1.6s ease-in-out infinite alternate; }
.use-guest_house:hover .use-case,
.use-guest_house:has(input:checked) .use-case { animation: guest-arrival 1.15s ease-in-out infinite alternate; }
.use-office:hover .use-detail,
.use-office:has(input:checked) .use-detail { animation: office-windows 1.7s ease-in-out infinite alternate; }
.use-workshop_living:hover .use-building,
.use-workshop_living:has(input:checked) .use-building { filter: drop-shadow(0 0 8px rgba(242,111,42,.45)); }
@keyframes home-light { to { filter: drop-shadow(0 0 5px #ffbb84); stroke: #fff1df; } }
@keyframes guest-arrival { to { transform: translate(-4px,-5px) rotate(-3deg); } }
@keyframes office-windows { to { filter: drop-shadow(0 0 4px #ffb178); stroke: #fff0dc; } }

/* Bedroom tiles retain their transition while reading clearly as rooms. */
.bedroom-number-layout { gap: clamp(1rem,3vw,2.5rem); margin-bottom: .65rem; }
.bedroom-model { min-height: 10.5rem; padding: .85rem; }
.bedroom-visual-grid { margin-bottom: .55rem; min-height: 6.5rem; }
.mini-bedroom { min-height: 3.45rem; }
.mini-bedroom em { align-items: center; background: rgba(17,24,39,.8); border: 1px solid rgba(255,177,126,.55); border-radius: 50%; color: #ffd0b2; display: flex; font-size: .55rem; font-style: normal; font-weight: 900; height: 1.15rem; justify-content: center; position: absolute; right: .35rem; top: .3rem; width: 1.15rem; }
.mini-bedroom:hover { filter: brightness(1.15); transform: rotateX(42deg) rotateZ(0) translateY(-3px); }

/* Storage choices use a cabinet and a visibly open flexible bay. */
.storage-illustration { align-items: center; background: radial-gradient(circle,rgba(242,111,42,.17),rgba(242,111,42,.035) 70%); border: 1px solid rgba(242,111,42,.25); border-radius: 1rem; display: flex; height: clamp(5rem,14vh,6.1rem); justify-content: center; overflow: hidden; width: 9rem; }
.storage-illustration svg { height: 88%; transition: transform 360ms cubic-bezier(.2,.8,.2,1); width: 88%; }
.visual-choice:hover .storage-illustration,
.visual-choice:has(input:checked) .storage-illustration { border-color: #f26f2a; box-shadow: 0 12px 30px rgba(242,111,42,.15); }
.visual-choice:hover .storage-illustration svg { transform: scale(1.055); }
.storage-door { transform-box: fill-box; transform-origin: right center; transition: transform 420ms cubic-bezier(.2,.8,.2,1); }
.visual-choice:hover .storage-door,
.visual-choice:has(input:checked) .storage-door { transform: skewY(-7deg) scaleX(.82); }
.visual-choice:hover .storage-shelf,
.visual-choice:has(input:checked) .storage-shelf { filter: drop-shadow(0 0 5px rgba(242,111,42,.52)); }

/* Review: previous choices left, client details right. */
.review-columns { align-items: stretch; display: grid; gap: 1rem; grid-template-columns: minmax(18rem,.9fr) minmax(25rem,1.1fr); margin: 0 auto; max-width: 68rem; width: 100%; }
.review-choice-column { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.1); border-radius: 1.1rem; padding: 1rem; }
.review-choice-column h3 { color: #fff3eb; font-size: .78rem; font-weight: 900; margin: 0 0 .75rem; }
.review-choice-column .wizard-summary { grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; max-width: none; }
.review-choice-column .wizard-summary > div { min-height: 3.5rem; padding: .65rem; }
.review-columns .project-contact-card { margin: 0; max-width: none; }
.review-columns .contact-card-heading { margin-bottom: .75rem; padding-bottom: .65rem; }
.review-columns .contact-field-grid { gap: .65rem; }
.review-columns .contact-field input,
.review-columns .contact-field select { min-height: 2.75rem; }

.themed-select { background-image: linear-gradient(180deg,#fff,#fff7f2) !important; scrollbar-color: #f26f2a #202736; scrollbar-width: thin; }
.themed-select::-webkit-scrollbar { width: 10px; }
.themed-select::-webkit-scrollbar-track { background: #202736; }
.themed-select::-webkit-scrollbar-thumb { background: #f26f2a; border: 2px solid #202736; border-radius: 999px; }
.themed-select option { background: #151b27; color: #fff; padding: .65rem; }
.themed-select option:checked { background: linear-gradient(#f26f2a,#f26f2a); color: #fff; }

@media (max-width: 760px) {
    .guided-planner { height: calc(100dvh - 4.35rem); padding: .4rem .55rem .55rem; }
    .guided-planner .wizard-topbar { min-height: 3.8rem; padding: .4rem .5rem; }
    .wizard-stage { height: calc(100dvh - 9rem); padding-top: .4rem; }
    .wizard-panel,
    .wizard-panel-wide,
    .model-question-panel { border-radius: 1rem; min-height: 0; padding: .8rem; }
    .question-heading { margin-bottom: .65rem; }
    .question-heading p { font-size: .58rem; }
    .question-heading h1,
    .question-heading h2 { font-size: clamp(1.35rem,7vw,1.8rem); }
    .question-heading span { font-size: .72rem; line-height: 1.35; }
    .model-question-panel .model-question-controls { width: 100%; }
    .building-transition-model { margin-top: 18.5rem; width: calc(100% - 2rem); }
    .model-question-panel > .wizard-continue { margin-top: 16rem; }
    .review-columns { gap: .55rem; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); }
    .review-choice-column,
    .review-columns .project-contact-card { border-radius: .8rem; padding: .6rem; }
    .review-choice-column h3 { font-size: .65rem; margin-bottom: .45rem; }
    .review-choice-column .wizard-summary { gap: .3rem; grid-template-columns: 1fr; }
    .review-choice-column .wizard-summary > div { min-height: 0; padding: .4rem; }
    .review-choice-column .wizard-summary span { font-size: .48rem; }
    .review-choice-column .wizard-summary strong { font-size: .62rem; }
    .review-columns .contact-card-heading p { display: none; }
    .review-columns .contact-card-heading > span { height: 2.4rem; width: 2.4rem; }
    .review-columns .contact-field-grid { gap: .4rem; grid-template-columns: 1fr; }
    .review-columns .contact-field > span:first-child { font-size: .55rem; }
    .review-columns .contact-field input,
    .review-columns .contact-field select { font-size: .66rem; min-height: 2.25rem; padding: .45rem .55rem; }
    .use-illustration { height: 4.5rem; width: 6.7rem; }
    .storage-illustration { height: 4.6rem; width: 7rem; }
}

@media (max-height: 720px) and (min-width: 761px) {
    .guided-planner .wizard-topbar { min-height: 3.8rem; }
    .wizard-stage { height: calc(100dvh - 9.2rem); }
    .wizard-panel { padding: .8rem 1.25rem; }
    .question-heading { margin-bottom: .55rem; }
    .question-heading h1,
    .question-heading h2 { font-size: 2rem; }
    .building-transition-model { margin-top: 8.5rem; width: 24rem; }
    .visual-choice { min-height: 8.5rem; }
}

@keyframes progress-sheen { 55%,100% { transform: translateX(120%); } }
@keyframes model-view-turn {
    0% { filter: brightness(1); transform: perspective(900px) rotateX(0) rotateY(0) scale(1); }
    42% { filter: brightness(1.18); transform: perspective(900px) rotateX(8deg) rotateY(-18deg) scale(.91); }
    72% { transform: perspective(900px) rotateX(-3deg) rotateY(7deg) scale(.97); }
    100% { filter: brightness(1); transform: perspective(900px) rotateX(0) rotateY(0) scale(1); }
}

@media (max-width: 900px) {
    .wizard-progress-percent { grid-column: 2; grid-row: 2; margin-top: -.6rem; }
}

@media (max-width: 620px) {
    .guided-planner .wizard-topbar { top: 4.7rem; }
    .guided-planner .wizard-back { font-size: 0; padding: .55rem; width: 2.7rem; }
    .guided-planner .wizard-back span { font-size: 1rem; }
    .wizard-progress-percent { font-size: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .building-transition-model.is-changing-view svg,
    .guided-planner .wizard-progress-track i::after { animation: none !important; }
}

/* Responsive numeric questions and architectural previews */
.number-control,
.numeric-question-card { display: grid; gap: .8rem; }
.number-stepper { align-items: stretch; display: grid; grid-template-columns: 2.85rem minmax(7rem, 1fr) 2.85rem; gap: .45rem; }
.number-stepper > button { background: rgba(242,111,42,.1); border: 1px solid rgba(242,111,42,.48); border-radius: .7rem; color: #ff955c; cursor: pointer; font-size: 1.35rem; font-weight: 900; min-height: 3rem; transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.number-stepper > button:hover { background: #f26f2a; box-shadow: 0 8px 24px rgba(242,111,42,.25); color: #fff; transform: translateY(-2px); }
.number-stepper > button:active { transform: translateY(0) scale(.94); }
.number-input-shell { align-items: center; background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.2); border-radius: .7rem; display: flex; min-width: 0; overflow: hidden; transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.number-input-shell:focus-within { border-color: #f26f2a; box-shadow: 0 0 0 4px rgba(242,111,42,.17); transform: translateY(-1px); }
.number-input-shell input { appearance: textfield; background: transparent !important; border: 0 !important; box-shadow: none !important; color: #101827; font-size: 1.08rem; font-weight: 900; min-height: 3rem; min-width: 0; padding: .65rem .2rem .65rem .85rem; text-align: center; width: 100%; }
.number-input-shell input::-webkit-inner-spin-button,
.number-input-shell input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.number-input-shell small { color: #697386; font-size: .68rem; font-weight: 850; padding-right: .75rem; text-transform: uppercase; }
.number-stepper-large { grid-template-columns: 3.2rem minmax(9.5rem, 1fr) 3.2rem; }
.number-stepper-large > button,
.number-stepper-large .number-input-shell input { min-height: 3.6rem; }
.dimension-control > span:first-child { align-items: center; display: flex; justify-content: space-between; }
.dimension-control output { color: #ff955c; font-size: .75rem; font-weight: 850; }

.dimension-preview { min-height: 17rem; perspective: 800px; }
.architectural-model { --model-width-scale: .95; --model-length-scale: .85; color: #ff9b65; min-height: 15rem; position: relative; width: min(100%, 23rem); }
.model-orbit { height: 11rem; left: 50%; position: absolute; top: 1.2rem; transform: translateX(-50%) rotateX(58deg) rotateZ(-30deg); transform-style: preserve-3d; width: 14rem; }
.model-floor,
.model-grid { background: linear-gradient(135deg, rgba(242,111,42,.62), rgba(242,111,42,.16)); border: 2px solid #ff8c4c; box-shadow: 0 25px 55px rgba(0,0,0,.32), inset 0 0 38px rgba(255,171,116,.11); height: 9rem; left: 50%; position: absolute; top: 50%; transform: translate(-50%,-50%) scaleX(var(--model-width-scale)) scaleY(var(--model-length-scale)); transition: clip-path 360ms cubic-bezier(.2,.8,.2,1), transform 360ms cubic-bezier(.2,.8,.2,1); width: 12rem; }
.model-grid { background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 1rem 1rem; border: 0; box-shadow: none; }
.model-wall { background: linear-gradient(180deg,#ffac7b,#e85c18); box-shadow: inset 0 0 14px rgba(255,255,255,.17); display: block; position: absolute; transition: height 360ms ease, transform 360ms ease, width 360ms ease; }
.model-wall-back { height: 2.3rem; left: 1rem; top: 1rem; transform: rotateX(-90deg) translateZ(-1.15rem) scaleX(var(--model-width-scale)); transform-origin: bottom; width: 12rem; }
.model-wall-side { height: 2.3rem; right: 1rem; top: 1rem; transform: rotateY(90deg) translateZ(1.15rem) scaleX(var(--model-length-scale)); transform-origin: bottom right; width: 9rem; }
.model-axis { background: currentColor; bottom: -.8rem; height: 1px; opacity: .65; position: absolute; }
.model-axis::after { border: 3px solid transparent; border-left-color: currentColor; content: ""; position: absolute; right: -5px; top: -2px; }
.model-axis-x { left: 1rem; width: 12rem; }
.model-axis-z { left: -.4rem; transform: rotate(90deg); transform-origin: left; width: 9rem; }
.plan-model.c_shape .model-floor,
.plan-model.c_shape .model-grid { clip-path: polygon(0 0,100% 0,100% 25%,38% 25%,38% 75%,100% 75%,100% 100%,0 100%); }
.plan-model > i,
.plan-model > b { background: rgba(9,13,22,.86); border: 1px solid rgba(242,111,42,.38); border-radius: 999px; bottom: 1rem; color: #ffd3bb; font-size: .65rem; font-style: normal; padding: .35rem .55rem; position: absolute; }
.plan-model > i { left: 1.3rem; }
.plan-model > b { right: 1.3rem; }
.plan-model > em { color: #aeb5c1; font-size: .62rem; font-style: normal; font-weight: 850; left: 50%; letter-spacing: .12em; position: absolute; text-transform: uppercase; top: .1rem; transform: translateX(-50%); }

.use-illustration { display: block; height: 6.7rem; width: 8.4rem; }
.use-illustration svg,
.storage-illustration svg { height: 100%; overflow: visible; width: 100%; }
.use-building,
.use-ground,
.use-detail,
.use-motion { fill: none; stroke: #f26f2a; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.use-building { fill: rgba(242,111,42,.11); }
.use-detail { stroke: #ffb083; }
.use-motion { transition: transform 320ms cubic-bezier(.2,.9,.3,1); }
.visual-choice:hover .use-building,
.visual-choice input:checked + .use-illustration .use-building { fill: rgba(242,111,42,.25); filter: drop-shadow(0 7px 10px rgba(242,111,42,.24)); }
.visual-choice:hover .use-case,
.visual-choice input:checked + .use-illustration .use-case { transform: translateY(-6px) rotate(-3deg); }
.visual-choice:hover .use-lift,
.visual-choice input:checked + .use-illustration .use-lift { animation: office-lift 1.5s ease-in-out infinite alternate; }
.visual-choice:hover .use-gear,
.visual-choice input:checked + .use-illustration .use-gear { animation: gear-turn 2.4s linear infinite; transform-origin: 43px 62px; }
.visual-choice:hover .use-smoke,
.visual-choice input:checked + .use-illustration .use-smoke { animation: smoke-drift 1.8s ease-in-out infinite; }
@keyframes office-lift { to { transform: translateY(-14px); } }
@keyframes gear-turn { to { transform: rotate(360deg); } }
@keyframes smoke-drift { 50% { opacity: .35; transform: translate(3px,-5px); } }

.bedroom-number-layout,
.numeric-model-layout { align-items: center; display: grid; gap: clamp(1.5rem,5vw,4.5rem); grid-template-columns: minmax(15rem,.75fr) minmax(18rem,1.25fr); margin: .5rem auto 1.4rem; max-width: 56rem; width: 100%; }
.numeric-question-card { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.12); border-radius: 1.25rem; padding: 1.2rem; }
.numeric-question-card > label { color: #eef1f5; font-size: .78rem; font-weight: 850; }
.numeric-question-card > small,
.numeric-question-card > p { color: #9fa7b3; font-size: .7rem; line-height: 1.5; margin: 0; }
.bedroom-model { background: radial-gradient(circle at 50% 0,rgba(242,111,42,.14),transparent 62%); border: 1px solid rgba(242,111,42,.18); border-radius: 1.3rem; min-height: 13rem; padding: 1.2rem; text-align: center; }
.bedroom-visual-grid { display: grid; gap: .55rem; grid-template-columns: repeat(3,minmax(3.2rem,1fr)); margin: .25rem auto 1rem; max-width: 23rem; min-height: 8rem; perspective: 500px; }
.mini-bedroom { animation: room-arrive 400ms cubic-bezier(.2,.9,.25,1) both; animation-delay: calc(var(--room-index) * 45ms); background: linear-gradient(145deg,rgba(242,111,42,.68),rgba(132,47,14,.35)); border: 1px solid #ff9b65; border-radius: .35rem; box-shadow: 7px 8px 0 rgba(0,0,0,.22), inset 0 0 18px rgba(255,205,177,.12); min-height: 3.8rem; position: relative; transform: rotateX(48deg) rotateZ(-3deg); }
.mini-bedroom i { background: #ffd2b8; border: 1px solid rgba(51,24,14,.45); border-radius: .18rem; bottom: .65rem; height: 1.15rem; left: .55rem; position: absolute; width: 1.95rem; }
.mini-bedroom b { background: #fff8ef; border-radius: .12rem; bottom: 1.4rem; height: .58rem; left: .7rem; position: absolute; width: .65rem; }
.bedroom-model > strong { color: #fff; display: block; font-size: .85rem; }
.bedroom-model > span { color: #9fa7b3; font-size: .67rem; }
@keyframes room-arrive { from { opacity: 0; transform: rotateX(48deg) rotateZ(-8deg) translateY(22px) scale(.7); } }

.storage-illustration { display: block; height: 6.6rem; width: 9rem; }
.storage-room,
.storage-shelf,
.storage-door,
.open-floor,
.open-pulse { fill: none; stroke: #f26f2a; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.storage-room { fill: rgba(242,111,42,.07); }
.storage-box { fill: rgba(242,111,42,.25); stroke: #ffad7a; transition: transform 260ms ease; }
.visual-choice:hover .box-one,
.visual-choice input:checked + .storage-illustration .box-one { transform: translateY(-7px); }
.visual-choice:hover .box-two,
.visual-choice input:checked + .storage-illustration .box-two { transform: translateX(5px); }
.visual-choice:hover .open-floor,
.visual-choice input:checked + .storage-illustration .open-floor { animation: open-space 1.5s ease-in-out infinite alternate; transform-origin: 63px 61px; }
.visual-choice input:checked + .storage-illustration .open-pulse { animation: check-pulse 1.4s ease-in-out infinite; transform-origin: 63px 42px; }
@keyframes open-space { to { transform: scaleX(1.14); } }
@keyframes check-pulse { 50% { opacity: .45; transform: scale(1.18); } }

.elevation-model { --height-scale: .76; height: 17rem; position: relative; }
.elevation-building { background: linear-gradient(100deg,#a74018,#f26f2a 54%,#ff9f68); border: 1px solid #ffb388; bottom: 2.2rem; box-shadow: 18px 18px 35px rgba(0,0,0,.28); height: calc(7.5rem * var(--height-scale)); left: 50%; position: absolute; transform: translateX(-42%) skewY(-2deg); transition: height 390ms cubic-bezier(.18,.8,.2,1); width: 12rem; }
.elevation-roof { border-bottom: 2.6rem solid #421c12; border-left: 6.6rem solid transparent; border-right: 6.6rem solid transparent; height: 0; left: 50%; position: absolute; top: -2.65rem; transform: translateX(-50%); width: 0; }
.elevation-window { background: linear-gradient(135deg,#ffd5b9,#f6a36e); border: 3px solid #442116; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); height: 2.2rem; position: absolute; top: 32%; width: 2.3rem; }
.window-one { left: 1.3rem; }.window-two { right: 1.3rem; }
.elevation-door { background: #24140f; bottom: 0; height: 3.5rem; left: 50%; position: absolute; transform: translateX(-50%); width: 2rem; }
.elevation-axis { border-left: 1px solid rgba(255,255,255,.35); bottom: 2.1rem; height: 12rem; left: 1.4rem; position: absolute; }
.elevation-axis::before,
.elevation-axis::after { border: 3px solid transparent; content: ""; left: -3px; position: absolute; }
.elevation-axis::before { border-bottom-color: #f26f2a; top: -5px; }.elevation-axis::after { border-top-color: #f26f2a; bottom: -5px; }
.elevation-model output { background: #f26f2a; border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 900; left: .1rem; padding: .35rem .55rem; position: absolute; top: 44%; }
.elevation-model > small { bottom: .2rem; color: #9da5b1; font-size: .61rem; left: 50%; letter-spacing: .14em; position: absolute; text-transform: uppercase; transform: translateX(-50%); }
.elevation-model.is-reforming .elevation-window { animation: window-glow 520ms ease; }
@keyframes window-glow { 50% { background: #fff0c4; box-shadow: 0 0 22px rgba(255,183,101,.65); } }

.roof-number-layout .roof-visual { height: 15rem; width: 100%; }
.roof-number-layout .roof-visual i,
.roof-number-layout .roof-visual b { top: 6.2rem; transition: transform 360ms cubic-bezier(.2,.85,.25,1); width: calc(50% - .9rem); }
.roof-number-layout .roof-visual em { bottom: 1.5rem; height: 7.2rem; }
.roof-number-layout .roof-visual output { background: rgba(242,111,42,.16); border: 1px solid rgba(242,111,42,.5); border-radius: 999px; bottom: .1rem; color: #ffd0b6; font-size: .78rem; font-weight: 900; left: 50%; padding: .4rem .7rem; position: absolute; transform: translateX(-50%); }
.roof-sun { background: #ff9a60; border-radius: 50%; box-shadow: 0 0 32px rgba(242,111,42,.52); height: 2.1rem; position: absolute; right: 1.5rem; top: 1rem; width: 2.1rem; }
.slope-shell { justify-content: center; }
.slope-shell small { font-size: 1rem; padding: 0 0 0 .8rem; }

.project-contact-card { background: linear-gradient(135deg,rgba(242,111,42,.12),rgba(255,255,255,.035)); border: 1px solid rgba(242,111,42,.3); border-radius: 1.2rem; margin: 1rem auto 1.4rem; max-width: 52rem; overflow: hidden; padding: 1.1rem; width: 100%; }
.contact-card-heading { align-items: center; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; gap: .85rem; margin-bottom: 1rem; padding-bottom: .9rem; }
.contact-card-heading > span { align-items: center; background: #f26f2a; border-radius: .7rem; color: #1a0d08; display: flex; flex-direction: column; font-size: .52rem; font-weight: 900; height: 3.3rem; justify-content: center; letter-spacing: .12em; line-height: 1; width: 3.3rem; }
.contact-card-heading > span strong { color: #fff; font-size: .82rem; letter-spacing: .03em; }
.contact-card-heading strong { color: #fff; font-size: .82rem; }
.contact-card-heading p { color: #aeb5bf; font-size: .67rem; line-height: 1.45; margin: .2rem 0 0; }
.contact-field-grid { display: grid; gap: .85rem; grid-template-columns: repeat(2,minmax(0,1fr)); }
.contact-field { display: grid; gap: .35rem; }
.contact-field > span:first-child { color: #d7dbe1; font-size: .67rem; font-weight: 850; }
.contact-field input,
.contact-field select { appearance: none; background: rgba(255,255,255,.96); border: 1px solid transparent; border-radius: .7rem; color: #101827; font-size: .78rem; min-height: 3rem; outline: 0; padding: .72rem .85rem; transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; width: 100%; }
.contact-field input:focus,
.contact-field select:focus { border-color: #f26f2a; box-shadow: 0 0 0 4px rgba(242,111,42,.18); transform: translateY(-1px); }
.contact-field input:valid:not(:placeholder-shown),
.contact-field select:valid { border-color: rgba(242,111,42,.52); }
.select-shell { display: block; position: relative; }
.select-shell::after { border-bottom: 2px solid #f26f2a; border-right: 2px solid #f26f2a; content: ""; height: .45rem; pointer-events: none; position: absolute; right: 1rem; top: 1.05rem; transform: rotate(45deg); transition: transform 180ms ease; width: .45rem; }
.select-shell:focus-within::after { transform: translateY(3px) rotate(225deg); }
.themed-select { cursor: pointer; padding-right: 2.5rem !important; }
.themed-select option { background: #151b27; color: #fff; }

@media (max-width: 720px) {
    .bedroom-number-layout,
    .numeric-model-layout { grid-template-columns: 1fr; gap: 1rem; }
    .contact-field-grid { grid-template-columns: 1fr; }
    .dimension-preview { min-height: 15rem; }
    .architectural-model { transform: scale(.88); }
}

@media (prefers-reduced-motion: reduce) {
    .use-motion,
    .mini-bedroom,
    .open-floor,
    .open-pulse { animation: none !important; }
}

/* One persistent model morphs from XY plan to XZ elevation and roof review. */
.wizard-stage { position: relative; }
.building-transition-model {
    align-self: start;
    background: radial-gradient(circle at 50% 30%, rgba(242,111,42,.14), rgba(5,9,16,.7) 66%);
    border: 1px solid rgba(242,111,42,.28);
    border-radius: 1.25rem;
    box-shadow: 0 24px 65px rgba(0,0,0,.32), inset 0 0 40px rgba(255,255,255,.025);
    display: none;
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    margin-right: clamp(2.2rem,8vw,7.5rem);
    margin-top: clamp(14rem,25vh,16.5rem);
    overflow: hidden;
    padding: .85rem;
    pointer-events: none;
    position: relative;
    width: min(29rem,47%);
    z-index: 4;
}
.building-transition-model.is-visible { animation: persistent-model-arrive 620ms cubic-bezier(.2,.82,.25,1) both; display: block; }
.building-model-toolbar { align-items: center; display: flex; justify-content: space-between; padding: 0 .2rem .3rem; }
.building-model-toolbar span { background: rgba(242,111,42,.16); border: 1px solid rgba(242,111,42,.4); border-radius: 999px; color: #ffb087; font-size: .62rem; font-weight: 900; letter-spacing: .1em; padding: .35rem .55rem; text-transform: uppercase; }
.building-model-toolbar strong { color: #fff4ed; font-size: .72rem; }
.building-transition-model svg { display: block; height: auto; overflow: visible; width: 100%; }
.building-transition-model > p { color: #9ba4b2; font-size: .61rem; font-weight: 800; letter-spacing: .12em; margin: -.25rem 0 .2rem; text-align: center; text-transform: uppercase; }

.live-plan-layer,
.live-elevation-layer { opacity: 0; transform-box: fill-box; transform-origin: center; transition: opacity 430ms ease, transform 650ms cubic-bezier(.18,.85,.2,1); }
.live-plan-layer { transform: perspective(500px) rotateX(55deg) rotateZ(-18deg) scale(.82); }
.live-elevation-layer { transform: perspective(700px) rotateY(24deg) translateX(40px) scale(.82); }
.state-plan .live-plan-layer { opacity: 1; transform: perspective(500px) rotateX(0) rotateZ(0) scale(1); }
.state-elevation .live-elevation-layer,
.state-roof .live-elevation-layer { opacity: 1; transform: perspective(700px) rotateY(0) translateX(0) scale(1); }
.live-plan-shadow { fill: rgba(0,0,0,.3); filter: blur(5px); transition: all 420ms ease; }
.live-plan-footprint { fill: rgba(242,111,42,.28); stroke: #ff8d50; stroke-width: 3; transition: all 420ms cubic-bezier(.2,.8,.2,1); }
.live-plan-grid-surface { fill: url(#live-plan-grid); transition: all 420ms cubic-bezier(.2,.8,.2,1); }
.live-plan-wall { fill: none; stroke: #ffb085; stroke-linecap: round; stroke-linejoin: round; stroke-width: 8; transition: d 420ms ease; }
.live-plan-axis,
.live-elevation-axis { fill: none; stroke: rgba(255,255,255,.44); stroke-linecap: round; stroke-width: 1.5; }
.live-plan-layer text,
.live-elevation-layer text { fill: #d9dde4; font-size: 12px; font-weight: 800; letter-spacing: .04em; }

.live-building-shadow { fill: rgba(0,0,0,.3); filter: blur(4px); }
.live-wall-front { fill: url(#live-wall-gradient); stroke: #ffb183; stroke-width: 2; transition: all 420ms cubic-bezier(.2,.8,.2,1), opacity 300ms ease; }
.live-wall-side { fill: url(#live-side-gradient); stroke: #db5a25; stroke-width: 2; transition: points 420ms cubic-bezier(.2,.8,.2,1), opacity 300ms ease; }
.live-window { fill: #ffd3b4; stroke: #38160b; stroke-width: 4; }
.live-openings path { fill: none; stroke: #7b3216; stroke-width: 2; }
.live-door { fill: #251008; stroke: #6b2911; stroke-width: 3; }
.live-openings circle { fill: #ffb17d; }
.live-front-gable { fill: #6d2710; stroke: #ff8b4b; stroke-width: 2; transition: points 420ms cubic-bezier(.2,.8,.2,1), fill 300ms ease, filter 300ms ease; }
.live-roof-side { fill: #43170a; stroke: #d9551d; stroke-width: 2; transition: points 420ms cubic-bezier(.2,.8,.2,1), fill 300ms ease, filter 300ms ease; }
.live-roof-outline { fill: none; stroke: #ff9a61; stroke-linecap: round; stroke-linejoin: round; stroke-width: 5; transition: d 420ms cubic-bezier(.2,.8,.2,1), stroke 300ms ease, filter 300ms ease; }
.state-roof .live-wall-front,
.state-roof .live-wall-side,
.state-roof .live-openings { opacity: .2; }
.state-roof .live-front-gable { fill: rgba(242,111,42,.6); filter: drop-shadow(0 0 13px rgba(242,111,42,.72)); }
.state-roof .live-roof-side { fill: rgba(169,57,14,.68); filter: drop-shadow(0 0 13px rgba(242,111,42,.55)); }
.state-roof .live-roof-outline { filter: drop-shadow(0 0 9px #f26f2a); stroke: #ffd1b7; stroke-width: 7; }
.building-transition-model.is-reforming .live-plan-footprint,
.building-transition-model.is-reforming .live-wall-front { animation: model-value-pulse 480ms ease; }
.state-roof.is-reforming .live-roof-group { animation: roof-value-pulse 480ms ease; transform-box: fill-box; transform-origin: center; }

.model-question-panel { min-height: 40rem; }
.model-question-panel .question-heading { margin-bottom: 2rem; }
.model-question-panel .model-question-controls { display: block; margin: .5rem 0 0; max-width: 21rem; width: 43%; }
.model-question-panel .dimension-controls { width: 100%; }
.model-question-panel .numeric-question-card { width: 100%; }
.model-question-panel > .wizard-continue { align-self: flex-start; margin-left: clamp(0rem,4vw,2.2rem); }

@keyframes persistent-model-arrive {
    from { opacity: 0; transform: translateY(45px) rotateY(-7deg) scale(.94); }
    to { opacity: 1; transform: translateY(0) rotateY(0) scale(1); }
}
@keyframes model-value-pulse { 50% { filter: brightness(1.35) drop-shadow(0 0 12px rgba(242,111,42,.45)); } }
@keyframes roof-value-pulse { 50% { filter: brightness(1.35); transform: translateY(-3px); } }

@media (max-width: 760px) {
    .model-question-panel { min-height: 55rem; }
    .model-question-panel .model-question-controls { max-width: none; width: 100%; }
    .model-question-panel > .wizard-continue { align-self: center; margin-left: 0; margin-top: 26rem; }
    .building-transition-model { justify-self: center; margin-right: 0; margin-top: 27rem; width: calc(100% - 2.5rem); }
}

@media (prefers-reduced-motion: reduce) {
    .building-transition-model,
    .building-transition-model.is-reforming .live-plan-footprint,
    .building-transition-model.is-reforming .live-wall-front,
    .state-roof.is-reforming .live-roof-group { animation: none !important; }
    .live-plan-layer,
    .live-elevation-layer { transition-duration: 1ms; }
}

.guided-planner { overflow: clip; }
.live-plan-layer,
.live-elevation-layer { transition-duration: 700ms; }

/* Final cascade: active question and progress share one viewport and width. */
.guided-planner { height: calc(100dvh - 4.35rem - 1px); }
.wizard-stage { height: calc(100dvh - 9.9rem - 1px); min-height: 0; }
.wizard-panel,
.wizard-panel-wide,
.model-question-panel { height: 100%; max-height: 100%; max-width: 76rem; min-height: 0; }
.building-transition-model { margin-right: clamp(2rem,6vw,6rem); margin-top: clamp(10.5rem,19vh,13rem); width: min(27rem,45%); }
.dimension-controls .number-stepper,
.model-question-controls .number-stepper,
.bedroom-number-layout .number-stepper { display: grid; grid-template-columns: 3.15rem minmax(8rem,1fr) 3.15rem; justify-content: normal; }

@media (max-width: 760px) {
    .wizard-stage { height: calc(100dvh - 9rem - 1px); }
    .wizard-panel,
    .wizard-panel-wide,
    .model-question-panel { min-height: 0; }
    .model-question-panel .model-question-controls { max-width: none; width: 100%; }
    .building-transition-model { justify-self: center; margin-right: 0; margin-top: 18.5rem; width: calc(100% - 2rem); }
    .model-question-panel > .wizard-continue { align-self: center; margin-left: 0; margin-top: 16rem; }
}

@media (max-width: 620px) {
    .guided-planner .wizard-topbar { top: auto; }

    .model-question-panel > .wizard-continue {
        bottom: .8rem;
        left: 0;
        margin: 0 auto;
        position: absolute;
        right: 0;
        width: min(13rem, calc(100% - 2rem));
    }

    .building-transition-model {
        height: 12rem;
        margin-top: 26rem;
        padding: .45rem .65rem;
    }

    .building-transition-model svg { height: 8.4rem; width: 100%; }
    .building-transition-model > p { margin-top: -.45rem; }
}

@media (max-width: 620px) and (max-height: 740px) {
    .question-heading h1,
    .question-heading h2 { font-size: 1.45rem; }

    .question-heading span { font-size: .65rem; }

    .shape-choice-grid .visual-choice,
    .use-choice-grid .visual-choice,
    .entrance-choice-grid .visual-choice,
    .binary-choice-grid .visual-choice { min-height: 7rem; padding: .45rem .3rem; }

    .shape-choice-grid .shape-icon,
    .entrance-choice-grid .entrance-icon { height: 4.5rem; transform: scale(.72); width: 5.5rem; }

    .use-illustration,
    .storage-illustration { height: 3.8rem; width: 5.7rem; }

    .dimension-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dimension-note { grid-column: 1 / -1; }
    .dimension-controls .number-stepper { grid-template-columns: 2.2rem minmax(0, 1fr) 2.2rem; }
    .dimension-controls .number-stepper > button,
    .dimension-controls .number-input-shell,
    .dimension-controls .number-input-shell input { min-height: 2.8rem; }

    .building-transition-model {
        box-sizing: border-box;
        height: 8rem;
        margin-top: 20rem;
    }

    .building-transition-model svg { height: 5.35rem; }
    .building-transition-model > p { display: none; }
    .model-question-panel > .wizard-continue { bottom: .55rem; min-height: 2.65rem; }

    #preferences-panel .question-heading { margin-bottom: .35rem; }
    #preferences-panel .question-heading h2 { font-size: 1.25rem; margin-top: .15rem; }
    #preferences-panel .question-heading span { display: none; }
    #preferences-panel .review-columns { gap: .4rem; }
    #preferences-panel .review-choice-column,
    #preferences-panel .project-contact-card { padding: .4rem; }
    #preferences-panel .review-choice-column h3 { font-size: .58rem; margin-bottom: .25rem; }
    #preferences-panel .review-choice-column .wizard-summary { gap: .12rem; }
    #preferences-panel .review-choice-column .wizard-summary > div { gap: .08rem; padding: .2rem .28rem; }
    #preferences-panel .review-choice-column .wizard-summary span { font-size: .4rem; line-height: 1; }
    #preferences-panel .review-choice-column .wizard-summary strong { font-size: .54rem; line-height: 1.1; }
    #preferences-panel .contact-card-heading { gap: .4rem; margin-bottom: .35rem; padding-bottom: .3rem; }
    #preferences-panel .contact-card-heading > span { font-size: .4rem; height: 2rem; width: 2rem; }
    #preferences-panel .contact-card-heading > span strong,
    #preferences-panel .contact-card-heading strong { font-size: .65rem; }
    #preferences-panel .contact-field-grid { gap: .2rem; }
    #preferences-panel .contact-field { gap: .12rem; }
    #preferences-panel .contact-field input,
    #preferences-panel .contact-field select { min-height: 1.9rem; padding: .3rem .45rem; }
    #preferences-panel .select-shell::after { right: .75rem; top: .65rem; }
    #preferences-panel .wizard-generate {
        bottom: .5rem;
        left: 0;
        margin: 0 auto;
        min-height: 2.65rem;
        position: absolute;
        right: 0;
        width: min(13rem, calc(100% - 2rem));
    }
    #preferences-panel .concept-note { display: none; }
}

.wizard-panel,
.wizard-panel-wide,
.model-question-panel { box-sizing: border-box; }

/* Account access and anonymous-plan entitlement states. */
.app-nav-controls { align-items: center; display: flex; gap: .55rem; }
.app-nav-login,
.app-nav-register,
.app-nav-logout button,
.app-nav-user { border-radius: 999px; font-size: .76rem; font-weight: 850; line-height: 1; padding: .7rem .85rem; white-space: nowrap; }
.app-nav-login,
.app-nav-logout button { background: transparent; border: 1px solid rgba(148,163,184,.34); color: #d8dee8; }
.app-nav-login:hover,
.app-nav-logout button:hover { border-color: #f26f2a; color: #ffb087; }
.app-nav-register { background: rgba(242,111,42,.14); border: 1px solid rgba(242,111,42,.38); color: #ffb087; }
.app-nav-user { color: #d8dee8; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-nav-logout { margin: 0; }
.app-nav-logout button { cursor: pointer; font: inherit; }

.render-plan-button.is-locked { align-items: center; display: inline-flex; gap: .35rem; opacity: .78; position: relative; text-decoration: none; }
.render-plan-button.is-locked:hover { opacity: 1; }
.locked-3d-popover { background: #fff; border: 1px solid rgba(148,163,184,.45); border-radius: .9rem; box-shadow: 0 20px 48px rgba(15,23,42,.25); color: #111827; display: grid; gap: .32rem; opacity: 0; padding: .55rem; pointer-events: none; position: absolute; right: calc(100% + .7rem); text-align: left; top: 0; transform: translateX(8px) scale(.97); transform-origin: right top; transition: opacity 160ms ease,transform 160ms ease,visibility 160ms ease; visibility: hidden; width: 15.5rem; z-index: 8; }
.locked-3d-popover::after { background: #fff; border-right: 1px solid rgba(148,163,184,.45); border-top: 1px solid rgba(148,163,184,.45); content: ""; height: .65rem; position: absolute; right: -.38rem; top: 1rem; transform: rotate(45deg); width: .65rem; }
.render-plan-button.is-locked:hover .locked-3d-popover,
.render-plan-button.is-locked:focus-visible .locked-3d-popover { opacity: 1; transform: translateX(0) scale(1); visibility: visible; }
.locked-3d-popover-art { aspect-ratio: 260 / 150; background: #e8eef3; border: 1px solid #e2e8f0; border-radius: .65rem; display: block; overflow: hidden; position: relative; }
.locked-3d-popover-art img { animation: locked-3d-preview-cycle 3s linear infinite; height: 100%; inset: 0; object-fit: cover; opacity: 0; position: absolute; width: 100%; }
.locked-3d-popover-art img:nth-child(2) { animation-delay: 1s; }
.locked-3d-popover-art img:nth-child(3) { animation-delay: 2s; }
@keyframes locked-3d-preview-cycle {
    0%,30% { opacity: 1; }
    33.333%,100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .locked-3d-popover-art img { animation: none; opacity: 0; }
    .locked-3d-popover-art img:first-child { opacity: 1; }
}
.locked-3d-popover strong { color: #111827; font-size: .75rem; line-height: 1.25; padding: .15rem .15rem 0; }
.locked-3d-popover small { color: #64748b; font-size: .64rem; font-weight: 650; line-height: 1.45; padding: 0 .15rem .15rem; }

.plan-card-locked { min-height: 25rem; overflow: hidden; position: relative; }
.locked-plan-content { filter: blur(3px); opacity: .24; pointer-events: none; transform: scale(1.015); }
.locked-plan-silhouette { background: #dbe3ec; border: 1px solid #cbd5e1; border-radius: 1rem; display: grid; gap: .5rem; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: repeat(2, 7rem); margin-top: 1.2rem; padding: .75rem; }
.locked-plan-silhouette i { background: #93a4b8; border: 2px solid #64748b; border-radius: .35rem; }
.locked-plan-silhouette i:first-child { grid-row: 1 / 3; }
.locked-plan-silhouette i:nth-child(4) { grid-column: 2 / 4; }
.plan-lock-overlay { align-items: center; background: radial-gradient(circle at 50% 42%,rgba(255,255,255,.97),rgba(255,255,255,.84) 48%,rgba(255,255,255,.62)); display: flex; flex-direction: column; inset: 0; justify-content: center; padding: 2rem; position: absolute; text-align: center; }
.plan-lock-icon { align-items: center; background: #111827; border: 5px solid rgba(242,111,42,.16); border-radius: 999px; display: flex; font-size: 1.35rem; height: 4rem; justify-content: center; width: 4rem; }
.plan-lock-overlay > p { color: #d95419; font-size: .68rem; font-weight: 950; letter-spacing: .15em; margin: 1rem 0 .35rem; text-transform: uppercase; }
.plan-lock-overlay > h2 { color: #111827; font-size: clamp(1.25rem,2vw,1.7rem); margin: 0; }
.plan-lock-overlay > span:not(.plan-lock-icon) { color: #64748b; font-size: .84rem; line-height: 1.6; margin-top: .6rem; max-width: 34rem; }
.plan-lock-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center; margin-top: 1.1rem; }
.plan-lock-primary,
.plan-lock-secondary { border-radius: .7rem; font-size: .78rem; font-weight: 900; padding: .78rem 1rem; text-decoration: none; }
.plan-lock-primary { background: #f26f2a; color: #fff; box-shadow: 0 12px 28px rgba(242,111,42,.24); }
.plan-lock-primary:hover { background: #d95419; }
.plan-lock-secondary { background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.plan-lock-secondary:hover { border-color: #f26f2a; color: #d95419; }

.auth-page { background: radial-gradient(circle at 20% 15%,rgba(242,111,42,.17),transparent 32%),#0f141d; min-height: calc(100dvh - 4.35rem); padding: clamp(2rem,7vw,6rem) 1rem; }
.auth-card { background: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 1.5rem; box-shadow: 0 32px 90px rgba(0,0,0,.34); display: grid; grid-template-columns: minmax(0,.9fr) minmax(20rem,1.1fr); margin: 0 auto; max-width: 58rem; overflow: hidden; }
.auth-card-copy { background: linear-gradient(145deg,#171e2a,#0c1119); color: #fff; padding: clamp(2rem,5vw,4rem); }
.auth-card-copy h1 { font-size: clamp(2rem,4vw,3.2rem); letter-spacing: -.045em; line-height: 1; margin: .7rem 0 1rem; }
.auth-card-copy > p:last-child { color: #aeb8c6; font-size: .92rem; line-height: 1.75; }
.auth-lock-mark { align-items: center; background: rgba(242,111,42,.16); border: 1px solid rgba(242,111,42,.4); border-radius: 1rem; display: flex; font-size: 1.35rem; height: 3.5rem; justify-content: center; margin-bottom: 2rem; width: 3.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; justify-content: center; padding: clamp(2rem,5vw,4rem); }
.auth-form label { color: #334155; display: grid; font-size: .75rem; font-weight: 850; gap: .4rem; }
.auth-form input { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: .7rem; color: #0f172a; min-height: 3rem; outline: none; padding: .7rem .85rem; }
.auth-form input:focus { border-color: #f26f2a; box-shadow: 0 0 0 3px rgba(242,111,42,.13); }
.auth-form label small,
.auth-form-errors { color: #b42318; font-size: .7rem; line-height: 1.45; }
.auth-form-errors ul { margin: 0; padding-left: 1rem; }
.auth-submit { background: #f26f2a; border: 0; border-radius: .75rem; color: #fff; cursor: pointer; font-size: .82rem; font-weight: 950; margin-top: .25rem; min-height: 3rem; padding: .75rem 1rem; }
.auth-submit:hover { background: #d95419; }
.auth-switch { color: #64748b; font-size: .76rem; margin: .2rem 0 0; text-align: center; }
.auth-switch a { color: #d95419; font-weight: 850; }

@media (max-width: 760px) {
    .app-nav-controls { gap: .3rem; }
    .app-nav-login,
    .app-nav-register,
    .app-nav-logout button,
    .app-nav-user { font-size: .65rem; padding: .6rem .65rem; }
    .app-nav-user { display: none; }
    .app-nav-controls .app-nav-action { display: none; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-card-copy { padding: 2rem; }
    .auth-lock-mark { margin-bottom: 1rem; }
    .auth-form { padding: 2rem; }
    .plan-card-locked { min-height: 28rem; }
    .plan-lock-overlay { padding: 1.25rem; }
    .locked-3d-popover { right: 0; top: calc(100% + .7rem); transform: translateY(-5px) scale(.97); transform-origin: top right; width: min(14rem,calc(100vw - 3rem)); }
    .locked-3d-popover::after { border-bottom: 0; border-left: 1px solid rgba(148,163,184,.45); border-right: 0; right: 1.25rem; top: -.38rem; }
    .render-plan-button.is-locked:hover .locked-3d-popover,
    .render-plan-button.is-locked:focus-visible .locked-3d-popover { transform: translateY(0) scale(1); }
}

@media (max-width: 360px) {
    .app-nav { gap: .5rem; }
    .app-brand-logo-surface { border-radius: .72rem; padding: .22rem .42rem; }
    .app-brand-logo { width: 7.75rem; }
    .app-nav-login,
    .app-nav-register,
    .app-nav-logout button { padding-left: .55rem; padding-right: .55rem; }
}
