.cx-page--planner {
    --cx-gold: #e8b968;
    --planner-panel: rgba(8, 11, 14, 0.9);
    --planner-panel-soft: rgba(255, 255, 255, 0.035);
    --planner-line: rgba(255, 244, 220, 0.115);
    --planner-muted: rgba(226, 234, 241, 0.56);
    height: 100%;
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 20%, rgba(232, 185, 104, 0.11), transparent 32rem),
        radial-gradient(circle at 18% 86%, rgba(73, 153, 196, 0.055), transparent 29rem),
        linear-gradient(145deg, #040506, #010203 68%);
}

.cx-planner [hidden] {
    display: none !important;
}

.cx-page--planner::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.cx-page--planner #stars-canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    pointer-events: none;
    mix-blend-mode: screen;
}

.cx-page--planner .cx-topbar {
    z-index: 500;
}

.cx-planner {
    position: fixed;
    z-index: 10;
    inset: clamp(86px, 11vh, 110px) clamp(16px, 2.4vw, 38px) clamp(14px, 2.2vh, 26px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
}

.cx-planner-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding-inline: 4px;
}

.cx-planner-head small {
    display: block;
    margin-bottom: 6px;
    color: var(--cx-gold);
    font: 600 0.55rem/1 var(--cx-mono);
    letter-spacing: 0.18em;
}

.cx-planner-head h1 {
    margin: 0;
    font: 620 clamp(1.45rem, 2.5vw, 2.35rem)/1 var(--cx-display);
    letter-spacing: -0.045em;
    text-transform: uppercase;
}

.cx-planner-head-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cx-planner button {
    color: inherit;
}

.cx-planner-quiet,
.cx-planner-primary,
.cx-camera-reset {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--planner-line);
    border-radius: 999px;
    background: rgba(255,255,255,0.025);
    cursor: pointer;
    font: 650 0.62rem/1 var(--cx-font);
    transition: 240ms ease;
}

.cx-planner-quiet:hover,
.cx-camera-reset:hover {
    border-color: rgba(255,183,0,0.4);
    color: var(--cx-gold);
}

.cx-planner-primary {
    border-color: rgba(255,183,0,0.38);
    background: var(--cx-gold);
    color: #090909 !important;
    font-weight: 800;
}

.cx-planner-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255,183,0,0.18);
}

.cx-planner-workspace {
    position: relative;
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(420px, 1fr) minmax(230px, 278px);
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.025), transparent 30%),
        rgba(3,5,7,0.72);
    box-shadow:
        0 34px 100px rgba(0,0,0,0.52),
        0 0 0 1px rgba(232,185,104,0.025),
        inset 0 1px 0 rgba(255,255,255,0.055);
    backdrop-filter: blur(30px) saturate(1.08);
}

.cx-planner-workspace::before {
    content: "";
    position: absolute;
    z-index: 30;
    top: 0;
    left: 8%;
    width: 28%;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255,223,164,0.68), transparent);
    box-shadow: 0 0 18px rgba(232,185,104,0.2);
}

.cx-mobile-sheet-head,
.cx-mobile-planner-dock,
.cx-mobile-sheet-scrim {
    display: none;
}

.cx-planner-panel {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,183,0,0.28) transparent;
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(255,183,0,0.05), transparent 16rem),
        var(--planner-panel);
}

.cx-planner-panel--setup {
    border-right: 1px solid var(--planner-line);
}

.cx-planner-panel--inspector {
    border-left: 1px solid var(--planner-line);
}

.cx-planner-panel-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 17px;
}

.cx-planner-panel-title > span {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border: 1px solid rgba(255,183,0,0.3);
    border-radius: 50%;
    color: var(--cx-gold);
    font: 600 0.55rem/1 var(--cx-mono);
}

.cx-planner-panel-title div {
    display: grid;
    gap: 3px;
}

.cx-planner-panel-title small {
    color: var(--planner-muted);
    font: 600 0.48rem/1 var(--cx-mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cx-planner-panel-title strong {
    font: 650 0.84rem/1.1 var(--cx-display);
}

.cx-room-library-trigger {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
    padding: 9px 11px 9px 9px;
    border: 1px solid rgba(255,183,0,0.23);
    border-radius: 13px;
    background:
        linear-gradient(135deg, rgba(255,183,0,0.085), transparent 52%),
        rgba(255,255,255,0.025);
    color: var(--cx-text) !important;
    cursor: pointer;
    text-align: left;
    transition: border-color 220ms ease, background 220ms ease, transform 220ms ease;
}

.cx-room-library-trigger:hover {
    border-color: rgba(255,183,0,0.5);
    background:
        linear-gradient(135deg, rgba(255,183,0,0.14), transparent 55%),
        rgba(255,255,255,0.04);
    transform: translateY(-1px);
}

.cx-room-library-trigger-icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255,183,0,0.25);
    border-radius: 11px;
    background: rgba(255,183,0,0.07);
}

.cx-room-library-trigger-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: rgba(255,224,153,0.86);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.25;
}

.cx-room-library-trigger > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.cx-room-library-trigger small {
    color: rgba(255,255,255,0.38);
    font: 550 0.46rem/1 var(--cx-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cx-room-library-trigger strong {
    overflow: hidden;
    color: rgba(255,255,255,0.88);
    font: 650 0.65rem/1.2 var(--cx-display);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-room-library-trigger b {
    color: var(--cx-gold);
    font: 300 1rem/1 var(--cx-display);
}

.cx-preset {
    min-width: 0;
    min-height: 124px;
    padding: 10px 9px 9px;
    border: 1px solid var(--planner-line);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    cursor: pointer;
    color: var(--planner-muted) !important;
    transition: 240ms ease;
}

.cx-preset svg {
    display: block;
    width: 118px;
    height: 64px;
    max-width: 100%;
    margin: 0 auto 8px;
}

.cx-preset polygon {
    fill: rgba(255,183,0,0.09);
    stroke: rgba(255,225,160,0.7);
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.cx-preset circle {
    fill: #ffb700;
    stroke: #fff4cf;
    stroke-width: 0.7;
}

.cx-preset text {
    fill: #fff4cf;
    font: 700 6px/1 var(--cx-mono);
}

.cx-preset .cx-preset-column {
    fill: rgba(77,174,255,0.5);
    stroke: rgba(187,225,255,0.95);
    stroke-width: 1;
}

.cx-preset span {
    display: block;
    overflow: hidden;
    color: rgba(255,255,255,0.82);
    font: 600 0.57rem/1.1 var(--cx-mono);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-preset small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,0.33);
    font: 500 0.46rem/1 var(--cx-mono);
}

.cx-preset:hover,
.cx-preset.is-active {
    border-color: rgba(255,183,0,0.48);
    background: rgba(255,183,0,0.065);
    transform: translateY(-1px);
}

.cx-preset.is-active {
    box-shadow: inset 0 0 0 1px rgba(255,183,0,0.12), 0 8px 22px rgba(0,0,0,0.18);
}

.cx-preset.is-active span {
    color: var(--cx-gold);
}

.cx-preset.is-confirming {
    border-color: rgba(255,101,73,0.75);
    background: rgba(255,101,73,0.1);
    animation: cx-preset-confirm 720ms ease-in-out infinite alternate;
}

@keyframes cx-preset-confirm {
    to { box-shadow: 0 0 0 3px rgba(255,101,73,0.08); }
}

body.cx-room-library-is-open {
    overflow: hidden;
}

.cx-room-library[hidden] {
    display: none;
}

.cx-room-library {
    position: fixed;
    z-index: 4000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.cx-room-library-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(2,4,7,0.78);
    cursor: default;
    backdrop-filter: blur(12px);
}

.cx-room-library-dialog {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(980px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 24px;
    background:
        radial-gradient(circle at 8% 0%, rgba(255,183,0,0.1), transparent 35%),
        linear-gradient(145deg, #151a20, #0b0e12 70%);
    box-shadow: 0 30px 100px rgba(0,0,0,0.62);
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    transition: opacity 180ms ease, transform 180ms ease;
}

.cx-room-library.is-open .cx-room-library-dialog {
    opacity: 1;
    transform: none;
}

.cx-room-library-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 26px 19px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cx-room-library-header small {
    color: var(--cx-gold);
    font: 600 0.5rem/1 var(--cx-mono);
    letter-spacing: 0.16em;
}

.cx-room-library-header h2 {
    margin: 7px 0 5px;
    color: #fff;
    font: 550 clamp(1.05rem, 2vw, 1.45rem)/1.1 var(--cx-display);
}

.cx-room-library-header p {
    margin: 0;
    color: rgba(255,255,255,0.42);
    font-size: 0.67rem;
}

.cx-room-library-close {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    background: rgba(255,255,255,0.035);
    color: rgba(255,255,255,0.7) !important;
    cursor: pointer;
    font: 300 1.25rem/1 var(--cx-display);
}

.cx-room-library-close:hover {
    border-color: rgba(255,183,0,0.45);
    color: var(--cx-gold) !important;
}

.cx-room-library-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 14px 26px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    scrollbar-width: none;
}

.cx-room-library-tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(255,255,255,0.025);
    color: rgba(255,255,255,0.54) !important;
    cursor: pointer;
    font: 550 0.56rem/1 var(--cx-mono);
}

.cx-room-library-tabs button:hover,
.cx-room-library-tabs button.is-active {
    border-color: rgba(255,183,0,0.43);
    background: rgba(255,183,0,0.09);
    color: var(--cx-gold) !important;
}

.cx-room-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 26px 26px;
    scrollbar-color: rgba(255,183,0,0.3) transparent;
}

.cx-room-library-grid .cx-preset[hidden] {
    display: none;
}

.cx-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 13px;
}

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

.cx-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--planner-muted);
    font-size: 0.59rem;
}

.cx-field-input {
    display: flex;
    align-items: center;
    height: 38px;
    overflow: hidden;
    border: 1px solid var(--planner-line);
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
}

.cx-field-input:focus-within {
    border-color: rgba(255,183,0,0.48);
}

.cx-field input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    padding: 0 4px 0 10px;
    background: transparent;
    color: var(--cx-text);
    font: 600 0.75rem/1 var(--cx-mono);
}

.cx-field-input b {
    padding-right: 9px;
    color: rgba(255,255,255,0.35);
    font: 500 0.58rem/1 var(--cx-mono);
}

.cx-edge-editor {
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--planner-line);
}

.cx-edge-list {
    display: grid;
    gap: 5px;
    max-height: 168px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.cx-edge-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 0.8fr);
    gap: 5px;
    align-items: center;
}

.cx-edge-select {
    height: 31px;
    padding: 0;
    border: 1px solid rgba(255,183,0,0.2);
    border-radius: 8px;
    background: rgba(255,183,0,0.04);
    color: rgba(255,215,125,0.76) !important;
    cursor: pointer;
    font: 600 0.54rem/1 var(--cx-mono);
}

.cx-edge-row.is-active .cx-edge-select {
    border-color: rgba(255,183,0,0.7);
    background: rgba(255,183,0,0.13);
    color: var(--cx-gold) !important;
}

.cx-edge-input {
    display: flex;
    align-items: center;
    height: 31px;
    overflow: hidden;
    border: 1px solid var(--planner-line);
    border-radius: 8px;
    background: rgba(255,255,255,0.025);
}

.cx-edge-input:focus-within {
    border-color: rgba(255,183,0,0.42);
}

.cx-edge-input input {
    width: 100%;
    min-width: 0;
    padding: 0 3px 0 7px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--cx-text);
    font: 500 0.57rem/1 var(--cx-mono);
}

.cx-edge-input small {
    padding-right: 6px;
    color: var(--planner-muted);
    font: 500 0.44rem/1 var(--cx-mono);
}

.cx-edge-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 7px;
}

.cx-add-edge,
.cx-remove-edge {
    width: 100%;
    min-height: 32px;
    border: 1px dashed rgba(255,183,0,0.35);
    border-radius: 9px;
    background: rgba(255,183,0,0.045);
    color: rgba(255,210,115,0.82) !important;
    cursor: pointer;
    font-size: 0.56rem;
}

.cx-remove-edge {
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.02);
    color: rgba(255,255,255,0.52) !important;
}

.cx-add-edge:hover,
.cx-remove-edge:hover:not(:disabled) {
    border-style: solid;
    background: rgba(255,183,0,0.1);
    color: var(--cx-gold) !important;
}

.cx-remove-edge:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.cx-planner-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.075);
}

.cx-planner-section-label {
    margin-bottom: 10px;
    color: var(--planner-muted);
    font: 600 0.52rem/1 var(--cx-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cx-color-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.72);
    font-size: 0.67rem;
}

.cx-color-field input {
    width: 34px;
    height: 28px;
    padding: 2px;
    border: 1px solid var(--planner-line);
    border-radius: 8px;
    background: transparent;
}

.cx-choice-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 6px;
}

#ceiling-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cx-choice-row button {
    min-width: 0;
    min-height: 31px;
    overflow: hidden;
    border: 1px solid var(--planner-line);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    color: var(--planner-muted);
    cursor: pointer;
    font-size: 0.57rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-choice-row button:hover,
.cx-choice-row button.is-active {
    border-color: rgba(255,183,0,0.4);
    background: rgba(255,183,0,0.07);
    color: var(--cx-gold);
}

.cx-planner-stage {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    background: #080b0e;
    container-type: inline-size;
}

.cx-planner-stagebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    min-height: 54px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--planner-line);
    background: rgba(5,7,9,0.88);
}

.cx-view-switch {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--planner-line);
    border-radius: 999px;
    background: rgba(255,255,255,0.025);
}

.cx-view-switch button {
    min-height: 32px;
    padding: 0 13px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--planner-muted);
    cursor: pointer;
    font: 650 0.59rem/1 var(--cx-font);
}

.cx-view-switch button.is-active {
    background: rgba(255,183,0,0.12);
    color: var(--cx-gold);
}

.cx-history-tools {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
}

.cx-history-tools button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--planner-line);
    border-radius: 9px;
    background: rgba(255,255,255,0.025);
    color: rgba(255,255,255,0.56);
    cursor: pointer;
}

.cx-history-tools button:hover:not(:disabled) {
    border-color: rgba(255,183,0,0.4);
    background: rgba(255,183,0,0.07);
    color: var(--cx-gold);
}

.cx-history-tools button:disabled {
    cursor: default;
    opacity: 0.25;
}

.cx-history-tools svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cx-grid-snap {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 3px 5px 3px 8px;
    border: 1px solid var(--planner-line);
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    color: rgba(255,255,255,0.54);
    font: 600 0.5rem/1 var(--cx-font);
}

.cx-grid-snap svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--cx-gold);
    stroke-width: 1.25;
    opacity: 0.78;
}

.cx-grid-snap select {
    height: 26px;
    padding: 0 22px 0 7px;
    border: 0;
    border-radius: 7px;
    outline: 0;
    background: rgba(255,183,0,0.08);
    color: rgba(255,220,140,0.92);
    cursor: pointer;
    font: 600 0.5rem/1 var(--cx-mono);
}

.cx-grid-snap select:focus-visible {
    box-shadow: 0 0 0 1px rgba(255,183,0,0.52);
}

.cx-grid-snap select option {
    background: #101418;
    color: #f4f6f8;
}

.cx-stage-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.cx-stage-tools::-webkit-scrollbar {
    display: none;
}

.cx-stage-tools button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    min-height: 42px;
    padding: 3px 5px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--planner-muted);
    cursor: pointer;
    font-size: 0.49rem;
}

.cx-stage-tools button span {
    line-height: 1.2;
    text-align: center;
}

html[lang="en"] .cx-stage-tools {
    gap: 6px;
}

html[lang="en"] .cx-stage-tools button {
    flex: 0 0 70px;
    min-width: 70px;
}

.cx-stage-tools svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cx-stage-tools button:hover,
.cx-stage-tools button.is-active {
    border-color: rgba(255,183,0,0.25);
    background: rgba(255,183,0,0.07);
    color: var(--cx-gold);
}

.cx-camera-reset {
    min-height: 32px;
    flex: 0 0 auto;
    padding-inline: 10px;
    font-size: 0.56rem;
}

@container (max-width: 1050px) {
    .cx-stage-tools button span,
    .cx-grid-snap span {
        display: none;
    }

    .cx-stage-tools button {
        min-width: 36px;
        padding-inline: 6px;
    }
}

.cx-planner-viewport {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 30%, rgba(255,183,0,0.055), transparent 26rem),
        linear-gradient(160deg, #111820, #080b0f 64%);
}

#planner-2d,
#planner-3d {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#planner-2d {
    display: block;
    cursor: crosshair;
}

#planner-3d {
    background: radial-gradient(circle at 65% 34%, #27313a, #090c10 68%);
}

#planner-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    touch-action: none;
}

#planner-3d canvas:active {
    cursor: grabbing;
}

.cx-planner-hint {
    position: absolute;
    z-index: 5;
    top: 17px;
    left: 50%;
    max-width: min(520px, 75%);
    padding: 8px 13px;
    border: 1px solid rgba(255,183,0,0.18);
    border-radius: 999px;
    background: rgba(3,5,7,0.62);
    color: rgba(255,255,255,0.54);
    font-size: 0.61rem;
    text-align: center;
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
    pointer-events: none;
}

.cx-planner-status {
    position: absolute;
    z-index: 5;
    right: 15px;
    bottom: 14px;
    left: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,0.44);
    font: 500 0.53rem/1 var(--cx-mono);
    pointer-events: none;
}

.cx-planner-status span:first-child {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,0.72);
}

.cx-planner-status i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cx-gold);
    box-shadow: 0 0 10px rgba(255,183,0,0.64);
}

.cx-plan-validation {
    flex: 0 0 auto;
    color: rgba(143,224,166,0.66);
}

.cx-plan-validation.is-invalid {
    color: #ff776e;
}

.cx-selection-popover {
    position: absolute;
    z-index: 24;
    top: 64px;
    left: 18px;
    width: min(286px, calc(100% - 24px));
    max-height: calc(100% - 116px);
    overflow: auto;
    padding: 13px;
    border: 1px solid rgba(255,183,0,0.28);
    border-radius: 16px;
    background:
        radial-gradient(circle at top left, rgba(255,183,0,0.09), transparent 12rem),
        rgba(6,8,10,0.94);
    box-shadow: 0 18px 54px rgba(0,0,0,0.52), inset 0 1px 0 rgba(255,255,255,0.06);
    backdrop-filter: blur(22px);
    transform-origin: 18px 18px;
    animation: cx-selection-popover-in 180ms ease both;
}

.cx-selection-popover[hidden] {
    display: none !important;
}

@keyframes cx-selection-popover-in {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cx-selection-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cx-selection-popover-head div {
    display: grid;
    gap: 4px;
}

.cx-selection-popover-head small {
    color: rgba(255,255,255,0.4);
    font: 600 0.46rem/1 var(--cx-mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.cx-selection-popover-head strong {
    color: rgba(255,255,255,0.92);
    font-size: 0.76rem;
}

.cx-selection-popover-head button {
    display: grid;
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    background: rgba(255,255,255,0.035);
    color: rgba(255,255,255,0.64);
    cursor: pointer;
    font: 400 1rem/1 var(--cx-font);
}

.cx-selection-popover-head button:hover {
    border-color: rgba(255,183,0,0.34);
    color: var(--cx-gold);
}

#inspector-empty p {
    margin: 0;
    color: var(--planner-muted);
    font-size: 0.7rem;
    line-height: 1.55;
}

.cx-inspector-badge {
    width: fit-content;
    margin-bottom: 14px;
    padding: 6px 9px;
    border: 1px solid rgba(255,183,0,0.3);
    border-radius: 999px;
    color: var(--cx-gold);
    font: 600 0.53rem/1 var(--cx-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cx-range-field {
    display: grid;
    gap: 9px;
    margin: 0 0 14px;
}

.cx-range-field > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255,255,255,0.68);
    font-size: 0.65rem;
}

.cx-range-field output {
    color: var(--cx-gold);
    font: 500 0.57rem/1 var(--cx-mono);
}

.cx-range-field input {
    width: 100%;
    accent-color: var(--cx-gold);
}

.cx-light-position,
.cx-column-position {
    margin-bottom: 14px;
}

.cx-light-position-grid,
.cx-column-position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.cx-light-position .cx-field,
.cx-column-position .cx-field {
    min-width: 0;
}

.cx-light-position .cx-field-input,
.cx-column-position .cx-field-input {
    min-width: 0;
}

.cx-light-position input,
.cx-column-position input {
    min-width: 0;
}

.cx-delete-object {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(255,90,90,0.24);
    border-radius: 9px;
    background: rgba(255,70,70,0.04);
    color: rgba(255,170,170,0.75) !important;
    cursor: pointer;
    font-size: 0.62rem;
}

.cx-profile-lighting-section {
    display: grid;
    gap: 12px;
}

.cx-profile-lighting-section .cx-toggle-field {
    margin-top: 0;
}

.cx-profile-lighting-section .cx-toggle-field + .cx-toggle-field {
    padding-top: 11px;
    border-top: 1px solid rgba(255,255,255,0.065);
}

.cx-sun-controls {
    display: grid;
    gap: 10px;
    padding-top: 11px;
    border-top: 1px solid rgba(255,255,255,0.065);
    transition: opacity 200ms ease;
}

.cx-sun-controls .cx-range-field {
    margin: 0;
}

.cx-sun-controls.is-disabled {
    opacity: 0.34;
    pointer-events: none;
}

.cx-toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 13px;
    cursor: pointer;
}

.cx-toggle-field > span {
    display: grid;
    gap: 3px;
}

.cx-toggle-field b {
    color: rgba(255,255,255,0.72);
    font-size: 0.64rem;
}

.cx-toggle-field small {
    color: var(--planner-muted);
    font-size: 0.55rem;
}

.cx-toggle-field input {
    position: absolute;
    opacity: 0;
}

.cx-toggle-field > i {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    border: 1px solid var(--planner-line);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    transition: 220ms ease;
}

.cx-toggle-field > i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transition: 220ms ease;
}

.cx-toggle-field input:checked + i {
    border-color: rgba(255,183,0,0.42);
    background: rgba(255,183,0,0.15);
}

.cx-toggle-field input:checked + i::after {
    left: 19px;
    background: var(--cx-gold);
    box-shadow: 0 0 10px rgba(255,183,0,0.5);
}

.cx-toggle-field--rgb input:checked + i {
    border-color: rgba(116,168,255,0.55);
    background: linear-gradient(90deg, rgba(0,242,255,0.22), rgba(255,0,234,0.22));
}

.cx-toggle-field--rgb input:checked + i::after {
    background: linear-gradient(135deg, #00f2ff, #ff00ea);
    box-shadow: 0 0 12px rgba(144,99,255,0.7);
}

.cx-planner-contact {
    display: grid;
    gap: 6px;
    margin-top: 19px;
    padding: 14px;
    border: 1px solid rgba(255,183,0,0.2);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(255,183,0,0.08), rgba(255,255,255,0.02));
}

.cx-planner-contact small {
    color: var(--planner-muted);
    font-size: 0.58rem;
}

.cx-planner-contact strong {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.85);
    font-size: 0.72rem;
}

.cx-planner-contact span {
    color: var(--cx-gold);
}

.cx-planner-toast {
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 28px;
    padding: 10px 15px;
    border: 1px solid rgba(255,183,0,0.3);
    border-radius: 999px;
    background: rgba(5,7,9,0.88);
    color: rgba(255,255,255,0.82);
    font-size: 0.65rem;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 12px);
    transition: 240ms ease;
    backdrop-filter: blur(18px);
}

.cx-planner-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

@media (max-width: 1180px) {
    .cx-planner-workspace {
        grid-template-columns: 220px minmax(360px, 1fr) 230px;
    }

    .cx-planner-panel {
        padding: 14px;
    }

    .cx-stage-tools button span {
        display: none;
    }

    .cx-stage-tools button {
        padding-inline: 8px;
    }

    .cx-grid-snap span {
        display: none;
    }
}

@media (max-width: 900px) {
    .cx-planner {
        inset: 74px 8px 8px;
        gap: 8px;
    }

    .cx-planner-head {
        align-items: center;
    }

    .cx-planner-head small,
    .cx-planner-head h1 {
        display: none;
    }

    .cx-planner-head-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .cx-planner-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: 116px minmax(300px, 1fr) 150px;
        border-radius: 19px;
    }

    .cx-planner-panel {
        display: flex;
        gap: 12px;
        padding: 10px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .cx-planner-panel--setup {
        border-right: 0;
        border-bottom: 1px solid var(--planner-line);
    }

    .cx-planner-panel--inspector {
        border-top: 1px solid var(--planner-line);
        border-left: 0;
    }

    .cx-planner-panel-title {
        min-width: 145px;
        margin: 0;
    }

    .cx-room-library-trigger {
        flex: 0 0 205px;
        align-self: stretch;
        margin: 0;
    }

    .cx-field-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 105px;
        min-width: max-content;
        margin: 0;
    }

    .cx-edge-editor {
        min-width: 550px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .cx-edge-editor .cx-planner-section-label {
        margin-bottom: 5px;
    }

    .cx-edge-list {
        display: flex;
        max-height: none;
        overflow: visible;
    }

    .cx-edge-row {
        flex: 0 0 170px;
    }

    .cx-add-edge {
        flex: 0 0 170px;
        margin: 0;
    }

    .cx-planner-panel--setup .cx-planner-section {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 400px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .cx-planner-panel--setup .cx-planner-section-label {
        display: none;
    }

    .cx-color-field {
        margin: 0;
    }

    .cx-choice-row {
        min-width: 150px;
        margin: 0;
    }

    .cx-profile-lighting-section {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 370px;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .cx-profile-lighting-section .cx-planner-section-label {
        display: none;
    }

    .cx-profile-lighting-section .cx-toggle-field + .cx-toggle-field {
        padding-top: 0;
        padding-left: 12px;
        border-top: 0;
        border-left: 1px solid rgba(255,255,255,0.065);
    }

    .cx-sun-section {
        min-width: 520px;
    }

    .cx-sun-controls {
        grid-template-columns: 145px 145px;
        gap: 10px;
        padding-top: 0;
        padding-left: 12px;
        border-top: 0;
        border-left: 1px solid rgba(255,255,255,0.065);
    }

    .cx-toggle-field {
        min-width: 170px;
        margin: 0;
    }

    .cx-planner-contact {
        min-width: 180px;
        margin: 0;
    }

    .cx-planner-stagebar {
        min-height: 48px;
        padding: 6px 8px;
    }

    .cx-grid-snap {
        min-height: 32px;
    }
}

@media (max-width: 600px) {
    .cx-room-library {
        padding: 8px;
    }

    .cx-room-library-dialog {
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .cx-room-library-header {
        gap: 12px;
        padding: 17px 16px 14px;
    }

    .cx-room-library-header p {
        display: none;
    }

    .cx-room-library-tabs {
        padding: 11px 16px;
    }

    .cx-room-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px 12px 18px;
    }

    .cx-room-library-grid .cx-preset {
        min-height: 112px;
        padding-inline: 6px;
    }

    .cx-room-library-grid .cx-preset svg {
        height: 55px;
    }

    .cx-page--planner .cx-topbar {
        top: 8px;
        left: 10px;
        right: 10px;
    }

    .cx-page--planner .cx-actions {
        gap: 0;
    }

    .cx-page--planner .cx-link {
        padding-inline: 6px;
        font-size: 0.48rem;
    }

    .cx-planner {
        top: 68px;
    }

    .cx-planner-head-actions {
        justify-content: stretch;
    }

    .cx-planner-head-actions button {
        flex: 1;
        min-height: 34px;
        padding-inline: 8px;
        font-size: 0.54rem;
    }

    .cx-planner-workspace {
        grid-template-rows: 104px minmax(280px, 1fr) 136px;
    }

    .cx-planner-panel-title {
        display: none;
    }

    .cx-field-grid {
        min-width: max-content;
    }

    .cx-field-input {
        height: 34px;
    }

    .cx-planner-panel--setup .cx-planner-section {
        min-width: 350px;
    }

    .cx-planner-stagebar {
        overflow-x: auto;
    }

    .cx-view-switch button {
        padding-inline: 9px;
        font-size: 0.54rem;
    }

    .cx-stage-tools {
        flex: 0 0 auto;
    }

    .cx-grid-snap {
        padding-left: 6px;
    }

    .cx-grid-snap select {
        max-width: 82px;
    }

    .cx-stage-tools button {
        flex-direction: row;
        min-width: 0;
        min-height: 31px;
        padding-inline: 6px;
    }

    .cx-camera-reset {
        font-size: 0 !important;
        width: 32px;
        padding: 0;
    }

    .cx-camera-reset::after {
        content: "↻";
        font-size: 1rem;
    }

    .cx-planner-hint {
        top: 10px;
        max-width: 88%;
        font-size: 0.54rem;
    }

    .cx-planner-status {
        right: 9px;
        bottom: 9px;
        left: 9px;
        font-size: 0.47rem;
    }

    .cx-planner-status #planner-summary {
        display: none;
    }

    .cx-planner-panel--inspector {
        padding: 8px 10px;
    }

    .cx-inspector-badge,
    .cx-range-field,
    .cx-delete-object {
        margin: 0;
    }

    .cx-range-field {
        min-width: 135px;
    }

    .cx-selection-popover {
        width: min(280px, calc(100% - 18px));
        max-height: calc(100% - 84px);
        padding: 11px;
        border-radius: 14px;
    }

    .cx-profile-lighting-section {
        min-width: 360px;
    }

    .cx-sun-section {
        min-width: 500px;
    }
}

/* Mobile spatial workspace
   The canvas remains the primary surface; setup and lighting become deliberate
   bottom sheets instead of permanently consuming horizontal space. */
@media (max-width: 600px) {
    html,
    body.cx-page--planner {
        width: 100%;
        height: 100%;
        height: 100dvh;
        min-width: 0;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .cx-page--planner {
        --planner-mobile-gutter: 8px;
        background:
            radial-gradient(circle at 76% 14%, rgba(232,185,104,0.12), transparent 19rem),
            linear-gradient(155deg, #080a0c, #010203 70%);
    }

    .cx-page--planner::after {
        background-size: 48px 48px;
        opacity: 0.72;
    }

    .cx-page--planner #stars-canvas {
        display: none;
    }

    .cx-page--planner .cx-topbar {
        top: max(12px, env(safe-area-inset-top));
        right: max(14px, env(safe-area-inset-right));
        left: max(16px, env(safe-area-inset-left));
        min-height: 52px;
        min-width: 0;
    }

    .cx-page--planner .cx-logo {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        background: rgba(7,9,11,0.82);
        box-shadow:
            inset 0 0 0 1px rgba(255,255,255,0.11),
            0 0 28px rgba(232,185,104,0.16);
    }

    .cx-page--planner .cx-actions {
        width: auto;
        max-width: none;
        height: 52px;
        gap: 3px;
        padding: 3px;
        border-color: rgba(255,244,220,0.13);
        background: rgba(5,7,9,0.72);
        box-shadow:
            0 14px 42px rgba(0,0,0,0.36),
            inset 0 1px 0 rgba(255,255,255,0.05);
    }

    .cx-page--planner .cx-actions > a.cx-link {
        display: none;
    }

    .cx-page--planner .cx-actions > button.cx-link,
    .cx-page--planner .cx-sound {
        width: 44px;
        height: 44px;
        min-height: 44px;
        flex-basis: 44px;
        padding: 0;
        font-size: 0.58rem;
    }

    .cx-planner {
        top: calc(max(12px, env(safe-area-inset-top)) + 58px);
        right: max(var(--planner-mobile-gutter), env(safe-area-inset-right));
        bottom: max(var(--planner-mobile-gutter), env(safe-area-inset-bottom));
        left: max(var(--planner-mobile-gutter), env(safe-area-inset-left));
        gap: 8px;
        min-width: 0;
    }

    .cx-planner-head {
        min-width: 0;
        padding: 0;
    }

    .cx-planner-head-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
    }

    .cx-planner-head-actions button {
        min-width: 0;
        min-height: 44px;
        padding: 0 8px;
        overflow: hidden;
        border-radius: 14px;
        font-size: 0.54rem;
        letter-spacing: 0.015em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cx-planner-primary {
        background:
            linear-gradient(135deg, #f2cb83, #d9a950);
        box-shadow: 0 8px 24px rgba(232,185,104,0.12);
    }

    .cx-export-long {
        display: none;
    }

    .cx-planner-workspace {
        position: relative;
        display: block;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        border-color: rgba(255,244,220,0.14);
        border-radius: 23px;
        background: #070a0d;
        box-shadow:
            0 26px 70px rgba(0,0,0,0.55),
            inset 0 1px 0 rgba(255,255,255,0.055);
        isolation: isolate;
    }

    .cx-planner-stage {
        position: absolute;
        z-index: 1;
        inset: 0;
        display: grid;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
        background: #070a0d;
    }

    .cx-planner-stagebar {
        display: grid;
        grid-template-areas:
            "view history snap"
            "tools tools tools";
        grid-template-columns: auto auto minmax(0, 1fr);
        gap: 7px;
        min-width: 0;
        min-height: 0;
        padding: 8px;
        overflow: visible;
        border-bottom-color: rgba(255,244,220,0.1);
        background:
            radial-gradient(circle at 10% 0%, rgba(232,185,104,0.09), transparent 13rem),
            rgba(5,7,9,0.94);
        box-shadow: 0 10px 34px rgba(0,0,0,0.24);
        backdrop-filter: blur(22px) saturate(1.1);
    }

    .cx-view-switch {
        grid-area: view;
        min-width: 0;
        height: 52px;
        padding: 3px;
        border-radius: 14px;
    }

    .cx-view-switch button {
        min-width: 58px;
        min-height: 44px;
        padding: 0 9px;
        border-radius: 11px;
        font-size: 0.55rem;
    }

    .cx-view-switch button.is-active {
        background:
            linear-gradient(135deg, rgba(232,185,104,0.2), rgba(232,185,104,0.08));
        box-shadow: inset 0 0 0 1px rgba(232,185,104,0.12);
    }

    .cx-history-tools {
        grid-area: history;
        gap: 4px;
    }

    .cx-history-tools button {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .cx-history-tools svg {
        width: 18px;
        height: 18px;
    }

    .cx-grid-snap {
        grid-area: snap;
        justify-self: stretch;
        min-width: 0;
        min-height: 52px;
        gap: 3px;
        padding: 3px 3px 3px 4px;
        border-radius: 13px;
    }

    .cx-grid-snap > span {
        display: none;
    }

    .cx-grid-snap select {
        width: 100%;
        max-width: none;
        height: 44px;
        min-width: 0;
        padding-right: 18px;
        font-size: 0.48rem;
    }

    .cx-stage-tools {
        position: relative;
        grid-area: tools;
        display: flex;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        gap: 5px;
        overflow-x: auto;
        padding-top: 7px;
        border-top: 1px solid rgba(255,255,255,0.065);
        scroll-padding-inline: 4px;
        scroll-snap-type: x proximity;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .cx-stage-tools button {
        flex: 0 0 67px;
        min-width: 67px;
        min-height: 48px;
        padding: 4px 5px;
        flex-direction: column;
        gap: 3px;
        border-radius: 12px;
        scroll-snap-align: start;
    }

    .cx-stage-tools button span,
    html[lang="en"] .cx-stage-tools button span {
        display: block !important;
        max-width: 100%;
        overflow: hidden;
        font-size: 0.47rem;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cx-stage-tools svg {
        width: 18px;
        height: 18px;
    }

    .cx-camera-reset {
        grid-area: snap;
        justify-self: stretch;
        width: auto;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 13px;
    }

    .cx-planner-viewport {
        min-width: 0;
        min-height: 0;
        background:
            radial-gradient(circle at 68% 24%, rgba(232,185,104,0.075), transparent 18rem),
            linear-gradient(160deg, #121920, #070a0d 66%);
    }

    #planner-2d,
    #planner-3d {
        max-width: 100%;
    }

    .cx-planner-hint {
        top: 11px;
        width: auto;
        max-width: calc(100% - 28px);
        padding: 7px 11px;
        border-color: rgba(232,185,104,0.16);
        background: rgba(3,5,7,0.72);
        font-size: 0.5rem;
        line-height: 1.35;
    }

    .cx-planner-status {
        right: 13px;
        bottom: 79px;
        left: 13px;
        gap: 8px;
        font-size: 0.48rem;
    }

    .cx-planner-status #planner-summary {
        display: none;
    }

    .cx-plan-validation {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cx-mobile-planner-dock {
        position: absolute;
        z-index: 60;
        right: 8px;
        bottom: 8px;
        left: 8px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        min-width: 0;
        padding: 4px;
        border: 1px solid rgba(255,244,220,0.15);
        border-radius: 18px;
        background:
            linear-gradient(145deg, rgba(255,255,255,0.055), transparent 42%),
            rgba(7,9,12,0.86);
        box-shadow:
            0 16px 45px rgba(0,0,0,0.55),
            inset 0 1px 0 rgba(255,255,255,0.06);
        backdrop-filter: blur(28px) saturate(1.2);
        -webkit-text-size-adjust: none;
        text-size-adjust: none;
    }

    .cx-mobile-sheet-scrim {
        position: absolute;
        z-index: 50;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(1,3,5,0.44);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            opacity 220ms ease,
            visibility 0s linear 220ms;
        backdrop-filter: blur(2px);
    }

    .cx-planner-workspace:has(.cx-planner-panel.is-mobile-open) .cx-mobile-sheet-scrim {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition:
            opacity 220ms ease,
            visibility 0s linear 0s;
    }

    .cx-mobile-planner-dock button {
        position: relative;
        display: grid;
        min-width: 0;
        min-height: 52px;
        place-items: center;
        align-content: center;
        gap: 3px;
        padding: 3px 2px;
        border: 1px solid transparent;
        border-radius: 13px;
        background: transparent;
        color: rgba(238,242,246,0.54);
        cursor: pointer;
        font: 650 0.48rem/1 var(--cx-font);
        transition:
            color 200ms ease,
            border-color 200ms ease,
            background 200ms ease,
            transform 200ms ease;
    }

    .cx-mobile-planner-dock button::after {
        content: "";
        position: absolute;
        right: 26%;
        bottom: 3px;
        left: 26%;
        height: 1px;
        background: var(--cx-gold);
        opacity: 0;
        box-shadow: 0 0 9px rgba(232,185,104,0.5);
        transform: scaleX(0.35);
        transition: 200ms ease;
    }

    .cx-mobile-planner-dock button.is-active {
        border-color: rgba(232,185,104,0.19);
        background: rgba(232,185,104,0.09);
        color: #f0c77d;
    }

    .cx-mobile-planner-dock button.is-active::after {
        opacity: 1;
        transform: scaleX(1);
    }

    .cx-mobile-planner-dock button:active {
        transform: scale(0.96);
    }

    .cx-mobile-planner-dock button > span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        font: 650 11px/1.1 var(--cx-font);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cx-mobile-planner-dock svg {
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.45;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .cx-mobile-sheet-head {
        position: sticky;
        z-index: 4;
        top: -1px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: center;
        gap: 10px;
        margin: 0 -15px 15px;
        padding: 19px 15px 10px;
        border-bottom: 1px solid rgba(255,255,255,0.075);
        background: rgba(9,12,15,0.94);
        backdrop-filter: blur(24px);
    }

    .cx-mobile-sheet-head > span {
        position: absolute;
        top: 7px;
        left: 50%;
        width: 38px;
        height: 3px;
        border-radius: 999px;
        background: rgba(255,255,255,0.2);
        transform: translateX(-50%);
    }

    .cx-mobile-sheet-head div {
        display: grid;
        gap: 3px;
        min-width: 0;
    }

    .cx-mobile-sheet-head small {
        color: var(--cx-gold);
        font: 600 0.46rem/1 var(--cx-mono);
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    .cx-mobile-sheet-head strong {
        overflow: hidden;
        color: rgba(255,255,255,0.9);
        font: 650 0.76rem/1.15 var(--cx-display);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .cx-mobile-sheet-head button {
        display: grid;
        width: 44px;
        height: 44px;
        place-items: center;
        padding: 0;
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 50%;
        background: rgba(255,255,255,0.035);
        color: rgba(255,255,255,0.68);
        cursor: pointer;
        font: 300 1.25rem/1 var(--cx-display);
    }

    .cx-planner-panel {
        position: absolute;
        z-index: 80;
        right: 8px;
        bottom: 72px;
        left: 8px;
        display: block;
        width: auto;
        height: min(67%, 540px);
        min-width: 0;
        min-height: 220px;
        max-height: calc(100% - 88px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 15px 18px;
        border: 1px solid rgba(255,244,220,0.15);
        border-radius: 23px;
        background:
            radial-gradient(circle at 6% 0%, rgba(232,185,104,0.11), transparent 18rem),
            rgba(9,12,15,0.965);
        box-shadow:
            0 28px 75px rgba(0,0,0,0.64),
            inset 0 1px 0 rgba(255,255,255,0.07);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(0, calc(100% + 90px), 0);
        transition:
            transform 360ms cubic-bezier(.2,.8,.2,1),
            opacity 220ms ease,
            visibility 0s linear 360ms;
        -webkit-overflow-scrolling: touch;
    }

    .cx-planner-panel.is-mobile-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
        transition:
            transform 360ms cubic-bezier(.2,.8,.2,1),
            opacity 220ms ease,
            visibility 0s linear 0s;
    }

    .cx-planner-panel--setup,
    .cx-planner-panel--inspector {
        border: 1px solid rgba(255,244,220,0.15);
    }

    .cx-planner-panel-title {
        display: none;
    }

    .cx-room-library-trigger {
        width: 100%;
        min-height: 60px;
        margin: 0 0 14px;
        padding: 8px 11px 8px 8px;
        border-radius: 15px;
    }

    .cx-room-library-trigger-icon {
        width: 44px;
        height: 44px;
    }

    .cx-field-grid,
    .cx-field-grid--height {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-auto-flow: row;
        grid-auto-columns: auto;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .cx-field-input {
        height: 46px;
        border-radius: 12px;
    }

    .cx-edge-editor {
        width: 100%;
        min-width: 0;
        margin: 16px 0 0;
        padding: 15px 0 0;
        border-top: 1px solid var(--planner-line);
    }

    .cx-edge-editor .cx-planner-section-label {
        margin-bottom: 9px;
    }

    .cx-edge-list {
        display: grid;
        width: 100%;
        max-height: 190px;
        overflow: auto;
    }

    .cx-edge-row {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) minmax(0, 0.86fr);
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .cx-edge-select,
    .cx-edge-input {
        height: 46px;
    }

    .cx-edge-input input {
        height: 100%;
    }

    .cx-edge-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 7px;
    }

    .cx-add-edge,
    .cx-remove-edge {
        min-width: 0;
        min-height: 44px;
        margin: 0;
        border-radius: 11px;
    }

    .cx-planner-panel--setup .cx-planner-section {
        display: block;
        width: 100%;
        min-width: 0;
        margin: 18px 0 0;
        padding: 16px 0 0;
        border-top: 1px solid rgba(255,255,255,0.075);
    }

    .cx-planner-panel--setup .cx-planner-section-label {
        display: block;
    }

    .cx-color-field {
        min-height: 44px;
        margin: 0 0 10px;
    }

    .cx-color-field input {
        width: 44px;
        height: 44px;
    }

    .cx-choice-row,
    #ceiling-choices {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        margin-top: 7px;
        gap: 7px;
    }

    .cx-choice-row button {
        min-height: 44px;
        border-radius: 11px;
        font-size: 0.58rem;
    }

    .cx-planner-panel--inspector {
        padding: 0 15px 18px;
    }

    .cx-profile-lighting-section,
    .cx-sun-section {
        display: grid;
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
        gap: 13px;
    }

    .cx-profile-lighting-section + .cx-profile-lighting-section {
        margin-top: 17px;
        padding-top: 16px;
        border-top: 1px solid rgba(255,255,255,0.075);
    }

    .cx-profile-lighting-section .cx-planner-section-label {
        display: block;
        margin-bottom: 0;
    }

    .cx-profile-lighting-section .cx-toggle-field + .cx-toggle-field {
        padding: 12px 0 0;
        border-top: 1px solid rgba(255,255,255,0.065);
        border-left: 0;
    }

    .cx-toggle-field {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        margin: 0;
    }

    .cx-toggle-field > i {
        width: 46px;
        height: 26px;
        flex-basis: 46px;
    }

    .cx-toggle-field > i::after {
        width: 18px;
        height: 18px;
    }

    .cx-toggle-field input:checked + i::after {
        left: 25px;
    }

    .cx-sun-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        min-width: 0;
        gap: 2px;
        padding: 12px 0 0;
        border-top: 1px solid rgba(255,255,255,0.065);
        border-left: 0;
    }

    .cx-range-field {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        margin: 0 0 10px;
    }

    .cx-range-field input[type="range"] {
        min-height: 44px;
    }

    .cx-light-position-grid,
    .cx-column-position-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cx-delete-object {
        min-height: 44px;
        margin: 2px 0 0;
        border-radius: 12px;
    }

    .cx-planner-contact {
        width: 100%;
        min-width: 0;
        min-height: 56px;
        margin: 17px 0 0;
        padding: 13px 14px;
        border-radius: 14px;
    }

    .cx-selection-popover {
        top: auto;
        right: 8px;
        bottom: 72px;
        left: 8px;
        width: auto;
        max-width: none;
        max-height: min(58%, 480px);
        padding: 18px 14px 15px;
        border-radius: 23px;
        transform-origin: 50% 100%;
        box-shadow:
            0 28px 72px rgba(0,0,0,0.64),
            inset 0 1px 0 rgba(255,255,255,0.07);
    }

    .cx-selection-popover::before {
        content: "";
        position: absolute;
        top: 7px;
        left: 50%;
        width: 38px;
        height: 3px;
        border-radius: 999px;
        background: rgba(255,255,255,0.2);
        transform: translateX(-50%);
    }

    .cx-selection-popover-head {
        min-height: 44px;
        margin-bottom: 13px;
    }

    .cx-selection-popover-head button {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .cx-room-library {
        align-items: end;
        padding:
            max(54px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .cx-room-library-dialog {
        width: 100%;
        max-height: calc(100dvh - max(62px, env(safe-area-inset-top)));
        border-radius: 23px;
        transform: translateY(24px) scale(0.99);
    }

    .cx-room-library-header {
        padding: 18px 15px 14px;
    }

    .cx-room-library-close {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .cx-room-library-tabs {
        padding: 10px 15px;
        scroll-snap-type: x proximity;
    }

    .cx-room-library-tabs button {
        min-height: 44px;
        scroll-snap-align: start;
    }

    .cx-room-library-grid {
        padding: 12px 12px max(18px, env(safe-area-inset-bottom));
    }

    .cx-room-library-grid .cx-preset {
        min-height: 124px;
    }

    .cx-planner-toast {
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + 78px);
        max-width: calc(100vw - 28px);
        border-radius: 14px;
        font-size: 0.58rem;
        line-height: 1.35;
        text-align: center;
    }
}

@media (max-width: 360px) {
    .cx-view-switch button {
        width: 44px;
        min-width: 44px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
    }

    .cx-view-switch button::after {
        font: 700 0.54rem/1 var(--cx-mono);
    }

    .cx-view-switch button[data-view="2d"]::after {
        content: "2D";
    }

    .cx-view-switch button[data-view="3d"]::after {
        content: "3D";
    }

    .cx-mobile-planner-dock button {
        font-size: 0.44rem;
    }

    .cx-mobile-planner-dock button > span {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cx-planner *,
    .cx-planner *::before,
    .cx-planner *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
