.enb-spatial-planner{--esp-ink:#0f172a;--esp-muted:#64748b;--esp-border:#dbe3ee;--esp-primary:#4f46e5;--esp-primary-dark:#3730a3;--esp-teal:#0f766e;--esp-soft:#f8fafc;color:var(--esp-ink);font-family:inherit}
.enb-spatial-launch{width:100%;padding:clamp(18px,3vw,34px) 0;background:linear-gradient(180deg,rgba(238,242,255,.72),rgba(255,255,255,.96));border-block:1px solid #e2e8f0}
.enb-spatial-launch__inner{width:calc(100% - 24px);max-width:var(--enb-global-shell-max,var(--enb-layout-shell,var(--enb-header-shell,1552px)));margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:24px;padding:clamp(18px,3vw,30px);border:1px solid #dbe3ee;border-radius:24px;background:rgba(255,255,255,.96);box-shadow:0 18px 50px rgba(15,23,42,.08)}
.enb-spatial-launch__copy{min-width:0}
.enb-spatial-launch__kicker{display:inline-flex;align-items:center;gap:.45rem;margin-bottom:8px;color:#4f46e5;font-size:.76rem;font-weight:900;letter-spacing:.09em;text-transform:uppercase}
.enb-spatial-launch h2{margin:0;color:#0f172a;font-size:clamp(1.45rem,2.4vw,2.15rem);font-weight:900;line-height:1.12;letter-spacing:-.025em}
.enb-spatial-launch p{max-width:780px;margin:10px 0 0;color:#475569;font-size:.98rem;line-height:1.7}
.enb-spatial-launch__source{display:flex;align-items:flex-start;gap:.45rem;margin-top:10px;color:#64748b;font-size:.76rem;line-height:1.55}
.enb-spatial-launch__source span{color:#059669;font-weight:900}
.enb-spatial-launch__actions{display:grid;gap:10px;min-width:min(390px,100%)}
.enb-spatial-btn{appearance:none;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;min-height:62px;width:100%;padding:10px 12px;border-radius:16px;border:1px solid transparent;text-align:left;font:inherit;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,background .18s ease,border-color .18s ease}
.enb-spatial-btn:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,23,42,.11)}
.enb-spatial-btn:focus-visible,.enb-spatial-close:focus-visible,.enb-spatial-tabs button:focus-visible,.enb-spatial-control-actions button:focus-visible,.enb-spatial-field input:focus-visible,.enb-spatial-field select:focus-visible,.enb-spatial-plan-group:focus-visible,.enb-spatial-planner .et-ar-tools button:focus-visible,.enb-spatial-planner .et-ar-tools a:focus-visible{outline:3px solid rgba(79,70,229,.3);outline-offset:2px}
.enb-spatial-btn--3d{background:#111827;color:#fff;border-color:#111827}
.enb-spatial-btn--place{background:#eef2ff;color:#312e81;border-color:#c7d2fe}
.enb-spatial-btn__icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:rgba(255,255,255,.12);font-size:1.08rem}
.enb-spatial-btn--place .enb-spatial-btn__icon{background:#fff}
.enb-spatial-btn span:nth-child(2){display:grid;gap:2px;min-width:0}
.enb-spatial-btn strong{font-size:.9rem;font-weight:900}
.enb-spatial-btn small{font-size:.7rem;font-weight:700;opacity:.76;line-height:1.35}
.enb-spatial-btn>span:last-child{font-size:1.15rem;font-weight:900}

.enb-spatial-modal[hidden]{display:none!important}
.enb-spatial-modal{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:16px;isolation:isolate}
.enb-spatial-modal__backdrop{position:absolute;inset:0;background:rgba(2,6,23,.78);backdrop-filter:blur(8px)}
.enb-spatial-dialog{position:relative;z-index:1;width:min(calc(100vw - 40px),var(--enb-global-shell-max,var(--enb-layout-shell,var(--enb-header-shell,1552px))));max-width:var(--enb-global-shell-max,var(--enb-layout-shell,var(--enb-header-shell,1552px)));height:min(920px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.22);border-radius:26px;background:#fff;box-shadow:0 30px 90px rgba(2,6,23,.38)}
.enb-spatial-dialog__header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 20px;border-bottom:1px solid #e2e8f0;background:#fff}
.enb-spatial-dialog__header>div{min-width:0}
.enb-spatial-dialog__kicker{display:block;margin-bottom:3px;color:#4f46e5;font-size:.68rem;font-weight:950;letter-spacing:.09em}
.enb-spatial-dialog__header h2{margin:0;color:#0f172a;font-size:clamp(1.25rem,2vw,1.8rem);font-weight:950;line-height:1.15;letter-spacing:-.02em}
.enb-spatial-dialog__header p{margin:5px 0 0;color:#64748b;font-size:.78rem;line-height:1.45}
.enb-spatial-close{appearance:none;flex:0 0 auto;display:grid;place-items:center;width:46px;height:46px;border:0;border-radius:50%;background:#0f172a;color:#fff;font:inherit;font-size:1.35rem;line-height:1;cursor:pointer}
.enb-spatial-tabs{display:flex;gap:8px;padding:10px 14px;border-bottom:1px solid #e2e8f0;background:#f8fafc}
.enb-spatial-tabs button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:42px;padding:8px 14px;border:1px solid #dbe3ee;border-radius:12px;background:#fff;color:#475569;font:inherit;font-size:.78rem;font-weight:900;cursor:pointer}
.enb-spatial-tabs button.is-active{background:#4f46e5;border-color:#4f46e5;color:#fff;box-shadow:0 7px 18px rgba(79,70,229,.18)}
.enb-spatial-dialog__body{min-height:0;flex:1 1 auto;display:grid;grid-template-columns:minmax(0,1fr) 355px;overflow:hidden}
.enb-spatial-stage-shell{min-width:0;min-height:0;position:relative;padding:14px;background:#eaf0f6}
.enb-spatial-pane{position:absolute;inset:14px;display:flex;flex-direction:column;min-width:0;min-height:0}
.enb-spatial-pane[hidden]{display:none!important}
.enb-spatial-stage-heading{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:baseline;gap:3px 8px;padding:0 2px 10px}
.enb-spatial-stage-heading>span{color:#4f46e5;font-size:.68rem;font-weight:950;letter-spacing:.07em;text-transform:uppercase}
.enb-spatial-stage-heading>strong{color:#0f172a;font-size:.88rem;font-weight:950}
.enb-spatial-stage-heading>small{width:100%;color:#64748b;font-size:.69rem;line-height:1.45}
.enb-spatial-3d-stage,.enb-spatial-placement-stage{position:relative;flex:1 1 auto;min-height:380px;overflow:hidden;border:1px solid #cbd5e1;border-radius:18px;background:#f8fafc;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.enb-spatial-3d-stage{background-image:radial-gradient(circle at 50% 35%,#fff 0,#f8fafc 42%,#e9eef6 100%)}
.enb-spatial-3d-stage model-viewer{display:block;width:100%;height:100%;min-height:380px;background:transparent;--poster-color:transparent}
.enb-spatial-3d-stage model-viewer[hidden],.enb-spatial-3d-stage svg[hidden]{display:none!important}
.enb-spatial-model-status{position:absolute;z-index:5;left:50%;top:50%;display:flex;align-items:center;gap:9px;max-width:calc(100% - 32px);padding:10px 13px;border:1px solid #dbe3ee;border-radius:12px;background:rgba(255,255,255,.94);color:#334155;box-shadow:0 12px 30px rgba(15,23,42,.12);transform:translate(-50%,-50%)}
.enb-spatial-model-status[hidden]{display:none!important}
.enb-spatial-model-status strong{font-size:.72rem;font-weight:850;line-height:1.35}
.enb-spatial-model-spinner{width:18px;height:18px;flex:0 0 auto;border:2px solid #c7d2fe;border-top-color:#4f46e5;border-radius:50%;animation:enbSpatialSpin .8s linear infinite}
@keyframes enbSpatialSpin{to{transform:rotate(360deg)}}
.enb-spatial-3d-stage svg{display:block;width:100%;height:100%;min-height:380px}
.enb-spatial-3d-stage svg .esp-top{fill:#818cf8;stroke:#4338ca;stroke-width:1.2}
.enb-spatial-3d-stage svg .esp-left{fill:#4f46e5;stroke:#3730a3;stroke-width:1.2}
.enb-spatial-3d-stage svg .esp-right{fill:#6366f1;stroke:#3730a3;stroke-width:1.2}
.enb-spatial-3d-stage svg .esp-front{fill:#4f46e5;stroke:#3730a3;stroke-width:1.2}
.enb-spatial-3d-stage svg .esp-shadow{fill:rgba(15,23,42,.12)}
.enb-spatial-3d-stage svg .esp-grid{stroke:#cbd5e1;stroke-width:1;opacity:.55}
.enb-spatial-3d-stage svg .esp-label{fill:#334155;font-size:15px;font-weight:800;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.enb-spatial-3d-stage svg .esp-dimension{fill:#64748b;font-size:13px;font-weight:700;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.enb-spatial-empty{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;padding:26px;text-align:center;color:#64748b;background:linear-gradient(180deg,rgba(248,250,252,.78),rgba(241,245,249,.94))}
.enb-spatial-empty[hidden]{display:none!important}
.enb-spatial-empty>span{font-size:2rem}
.enb-spatial-empty strong{margin-top:8px;color:#334155;font-size:1rem;font-weight:900}
.enb-spatial-empty p{max-width:390px;margin:6px 0 0;font-size:.76rem;line-height:1.55}

.enb-spatial-placement-stage{display:grid;place-items:center;padding:18px;background-color:#f8fafc;background-image:linear-gradient(rgba(99,102,241,.075) 1px,transparent 1px),linear-gradient(90deg,rgba(99,102,241,.075) 1px,transparent 1px);background-size:28px 28px}
.enb-spatial-area{position:relative;overflow:hidden;width:min(92%,820px);height:min(88%,620px);min-width:180px;min-height:180px;border:2px solid #64748b;border-radius:14px;background:rgba(255,255,255,.88);box-shadow:0 20px 50px rgba(15,23,42,.12)}
.enb-spatial-area__label{position:absolute;z-index:4;top:8px;left:8px;max-width:calc(100% - 16px);padding:5px 8px;border-radius:9px;background:rgba(15,23,42,.84);color:#fff;font-size:.66rem;font-weight:850;pointer-events:none}
.enb-spatial-plan-group{position:absolute;z-index:3;left:0;top:0;min-width:18px;min-height:18px;touch-action:none;cursor:grab;outline:none}
.enb-spatial-plan-group:active{cursor:grabbing}
.enb-spatial-plan-group.is-disabled{cursor:not-allowed;opacity:.86}
.enb-spatial-allowance{position:absolute;inset:0;border:2px dashed rgba(245,158,11,.9);border-radius:9px;background:rgba(251,191,36,.1);pointer-events:none}
.enb-spatial-units{position:absolute;pointer-events:none}
.enb-spatial-unit{position:absolute;display:grid;place-items:center;overflow:hidden;border:1px solid #4338ca;background:linear-gradient(135deg,#818cf8,#4f46e5);color:#fff;font-size:.62rem;font-weight:900;line-height:1;box-shadow:0 4px 10px rgba(79,70,229,.16)}
.enb-spatial-unit.is-circle{border-radius:50%}
.enb-spatial-unit span{display:block;max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.enb-spatial-plan-group.is-overflow .enb-spatial-unit{border-color:#b91c1c;background:linear-gradient(135deg,#fb7185,#dc2626)}
.enb-spatial-plan-group.is-overflow .enb-spatial-allowance{border-color:#dc2626;background:rgba(239,68,68,.09)}
.enb-spatial-legend{display:flex;flex-wrap:wrap;gap:8px 14px;padding:10px 2px 0;color:#64748b;font-size:.66rem;font-weight:750}
.enb-spatial-legend span{display:inline-flex;align-items:center;gap:5px}
.enb-spatial-legend i{display:inline-block;width:12px;height:12px;border-radius:3px}
.enb-spatial-legend__area{border:2px solid #64748b;background:#fff}
.enb-spatial-legend__item{background:#6366f1;border:1px solid #4338ca}
.enb-spatial-legend__allowance{background:rgba(251,191,36,.16);border:2px dashed #f59e0b}

.enb-spatial-controls{min-height:0;overflow:auto;padding:14px;border-left:1px solid #dbe3ee;background:#fff;overscroll-behavior:contain}
.enb-spatial-control-card{padding:12px;border:1px solid #e2e8f0;border-radius:15px;background:#f8fafc}
.enb-spatial-control-card+.enb-spatial-control-card,.enb-spatial-result,.enb-spatial-metrics,.enb-spatial-safety-note{margin-top:10px}
.enb-spatial-control-card h3{margin:0 0 9px;color:#0f172a;font-size:.75rem;font-weight:950;letter-spacing:.02em}
.enb-spatial-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.enb-spatial-field-grid--single{grid-template-columns:1fr}
.enb-spatial-field{display:grid;gap:5px;min-width:0}
.enb-spatial-field--wide{grid-column:1/-1}
.enb-spatial-field+.enb-spatial-field--wide,.enb-spatial-field--wide+.enb-spatial-field-grid{margin-top:8px}
.enb-spatial-field>span{color:#475569;font-size:.66rem;font-weight:850;line-height:1.3}
.enb-spatial-field input,.enb-spatial-field select{width:100%;height:40px;padding:0 9px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;font:inherit;font-size:.76rem;font-weight:750;outline:none}
.enb-spatial-field input:disabled{background:#eef2f7;color:#64748b;cursor:not-allowed}
.enb-spatial-control-note{margin:8px 0 0;padding:7px 8px;border-left:3px solid #818cf8;border-radius:0 8px 8px 0;background:#eef2ff;color:#475569;font-size:.64rem;line-height:1.48}
.enb-spatial-control-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.enb-spatial-control-actions button{appearance:none;min-height:40px;padding:6px 5px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#334155;font:inherit;font-size:.66rem;font-weight:850;cursor:pointer}
.enb-spatial-control-actions button:hover{background:#eef2ff;border-color:#a5b4fc;color:#3730a3}

.enb-spatial-planner .et-ar-tools{margin-top:10px;padding:12px;border:1px solid #cbd5e1;border-radius:15px;background:#f8fafc}
.enb-spatial-planner .et-ar-tools h3{margin:0 0 8px;color:#0f172a;font-size:.75rem;font-weight:950;line-height:1.35}
.enb-spatial-planner .et-ar-tools p{margin:6px 0 0;color:#64748b;font-size:.66rem;line-height:1.5}
.enb-spatial-planner .et-ar-tools button{appearance:none;display:block;width:100%;min-height:44px;margin-top:8px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:11px;background:#fff;color:#17213a;font:inherit;font-size:.72rem;font-weight:900;line-height:1.3;cursor:pointer}
.enb-spatial-planner .et-ar-tools button:first-of-type{background:#111827;border-color:#111827;color:#fff}
.enb-spatial-planner .et-ar-tools button:hover:not(:disabled){border-color:#a5b4fc;background:#eef2ff;color:#3730a3}
.enb-spatial-planner .et-ar-tools button:first-of-type:hover:not(:disabled){border-color:#312e81;background:#312e81;color:#fff}
.enb-spatial-planner .et-ar-tools button:disabled{opacity:.58;cursor:wait}
.enb-spatial-planner .et-ar-tools [data-et-ar-status]:empty{display:none}
.enb-spatial-planner .et-ar-tools [data-et-ar-status]:not(:empty){padding:8px 9px;border-radius:10px;background:#eef2ff;color:#3730a3;font-weight:800}
.enb-spatial-planner .et-ar-tools [data-et-qr-panel]{margin-top:10px;padding:10px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}
.enb-spatial-planner .et-ar-tools [data-et-qr-panel][hidden]{display:none!important}
.enb-spatial-planner .et-ar-tools img{display:block;width:min(100%,260px);height:auto;margin-inline:auto;border-radius:8px;background:#fff}
.enb-spatial-planner .et-ar-tools a{display:flex;align-items:center;justify-content:center;min-height:44px;margin-top:8px;padding:7px 9px;overflow-wrap:anywhere;border-radius:9px;color:#3730a3;font-size:.68rem;font-weight:850;line-height:1.4;text-align:center;text-decoration:none}
.enb-spatial-planner .et-ar-tools a:hover{background:#eef2ff;text-decoration:underline}
.enb-spatial-result{display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;padding:11px;border:1px solid #dbe3ee;border-radius:15px;background:#f8fafc}
.enb-spatial-result__icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#e2e8f0;font-size:1.05rem}
.enb-spatial-result small{display:block;color:#64748b;font-size:.6rem;font-weight:950;letter-spacing:.08em}
.enb-spatial-result strong{display:block;margin-top:2px;color:#0f172a;font-size:.78rem;font-weight:950;line-height:1.25}
.enb-spatial-result p{margin:3px 0 0;color:#64748b;font-size:.65rem;line-height:1.45}
.enb-spatial-result[data-state="fit"]{border-color:#86efac;background:#f0fdf4}
.enb-spatial-result[data-state="fit"] .enb-spatial-result__icon{background:#dcfce7}
.enb-spatial-result[data-state="rotate"]{border-color:#fcd34d;background:#fffbeb}
.enb-spatial-result[data-state="rotate"] .enb-spatial-result__icon{background:#fef3c7}
.enb-spatial-result[data-state="fail"]{border-color:#fca5a5;background:#fef2f2}
.enb-spatial-result[data-state="fail"] .enb-spatial-result__icon{background:#fee2e2}
.enb-spatial-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.enb-spatial-metrics>div{padding:9px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}
.enb-spatial-metrics span{display:block;color:#64748b;font-size:.58rem;font-weight:850;line-height:1.35}
.enb-spatial-metrics strong{display:block;margin-top:3px;color:#312e81;font-size:.76rem;font-weight:950;line-height:1.3}
.enb-spatial-safety-note{display:flex;gap:8px;padding:10px;border-left:3px solid #f59e0b;border-radius:0 12px 12px 0;background:#fffbeb;color:#92400e}
.enb-spatial-safety-note>span{flex:0 0 auto}
.enb-spatial-safety-note p{margin:0;font-size:.63rem;line-height:1.48}
body.enb-spatial-modal-open{overflow:hidden}

@media (min-width:640px){
  .enb-spatial-launch__inner{width:calc(100% - 40px)}
}
@media (min-width:1280px){
  .enb-spatial-launch__inner{width:var(--enb-global-shell-width,min(calc(100% - var(--enb-layout-edge-gap,48px)),var(--enb-layout-shell,var(--enb-header-shell,1552px))))}
  .enb-spatial-dialog{width:min(calc(100vw - var(--enb-global-shell-edge,var(--enb-layout-edge-gap,48px))),var(--enb-global-shell-max,var(--enb-layout-shell,var(--enb-header-shell,1552px))))}
}
@media (max-width:1050px){
  .enb-spatial-launch__inner{grid-template-columns:1fr}
  .enb-spatial-launch__actions{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
  .enb-spatial-dialog__body{grid-template-columns:minmax(0,1fr) 320px}
}
@media (max-width:820px){
  .enb-spatial-modal{padding:0}
  .enb-spatial-dialog{width:100%;height:100dvh;max-height:100dvh;border-radius:0;border:0}
  .enb-spatial-dialog__header{padding:12px 14px}
  .enb-spatial-close{width:44px;height:44px}
  .enb-spatial-tabs{padding:8px 10px;overflow:auto;scrollbar-width:none}
  .enb-spatial-tabs::-webkit-scrollbar{display:none}
  .enb-spatial-tabs button{flex:1 1 0;min-width:0}
  .enb-spatial-dialog__body{display:block;overflow:auto;background:#eaf0f6;overscroll-behavior:contain}
  .enb-spatial-stage-shell{height:min(54dvh,520px);min-height:390px;padding:10px}
  .enb-spatial-pane{inset:10px}
  .enb-spatial-controls{overflow:visible;border-left:0;border-top:1px solid #dbe3ee;padding:12px;background:#fff}
  .enb-spatial-3d-stage,.enb-spatial-placement-stage,.enb-spatial-3d-stage svg,.enb-spatial-3d-stage model-viewer{min-height:300px}
}
@media (max-width:640px){
  .enb-spatial-launch{padding:14px 0}
  .enb-spatial-launch__inner{gap:15px;padding:17px;border-radius:19px}
  .enb-spatial-launch h2{font-size:1.35rem}
  .enb-spatial-launch p{font-size:.86rem;line-height:1.6}
  .enb-spatial-launch__actions{grid-template-columns:1fr}
  .enb-spatial-btn{min-height:58px}
  .enb-spatial-dialog__header p{display:none}
  .enb-spatial-dialog__kicker{font-size:.58rem}
  .enb-spatial-dialog__header h2{font-size:1.02rem}
  .enb-spatial-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}
  .enb-spatial-tabs button{width:100%;min-width:0;padding:8px 6px;font-size:.72rem;line-height:1.2;white-space:normal}
  .enb-spatial-stage-shell{height:48dvh;min-height:340px}
  .enb-spatial-stage-heading small{font-size:.62rem}
  .enb-spatial-3d-stage,.enb-spatial-placement-stage,.enb-spatial-3d-stage svg,.enb-spatial-3d-stage model-viewer{min-height:250px}
  .enb-spatial-placement-stage{padding:10px}
  .enb-spatial-field input,.enb-spatial-field select{height:44px;font-size:.8rem}
  .enb-spatial-control-actions button{min-height:44px}
}
@media (max-width:390px){
  .enb-spatial-field-grid{grid-template-columns:1fr}
  .enb-spatial-control-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  .enb-spatial-control-actions button{padding-inline:3px;font-size:.62rem}
  .enb-spatial-metrics{grid-template-columns:1fr}
  .enb-spatial-stage-shell{min-height:330px}
}
@media (prefers-reduced-motion:reduce){
  .enb-spatial-btn{transition:none}
  .enb-spatial-model-spinner{animation:none}
}
