:root {
  --accent:#bfa6ff; --accent-hover:#d5c7ff; --accent-strong:#7359b8; --accent-strong-hover:#8469cc;
  --accent-focus:rgba(191,166,255,.18); --accent-border:rgba(191,166,255,.76);
  --designer-primary-hover:#60469e; --color-dark-purple:#201a30; --color-blue:#7157aa; --color-blue-2:#594780;
  --color-grey-p:#686472;
  --sidebar-transition-duration:220ms;
}
#viewport { --viewport-inset:14px; }
#designer-beta { margin-left:7px; padding:2px 6px; border:1px solid #b69cdd; border-radius:4px; background:#ede4fa; color:#69409a; font:600 10px/1.2 var(--ui-font); }
#drop-hint { position:absolute; left:50%; bottom:calc(var(--viewport-inset) + 48px); transform:translateX(-50%); z-index:2; width:max-content; box-sizing:border-box; max-width:calc(100% - 24px); padding:9px 14px; border:1px solid #a599bf; border-radius:8px; background:#322d40; color:#fff; text-align:center; pointer-events:none; font:500 12px/1.4 var(--ui-font); }
button,input,select,textarea { font-family:inherit; }
#open-wizard-button,#open-wizard .main-button,#drop-accept { background:var(--accent-strong); color:white; }
#open-wizard-button:hover,#drop-accept:hover { background:var(--designer-primary-hover); }
:focus-visible { outline:2px solid var(--accent-strong); outline-offset:2px; }
.config-preview .view-navigation button { padding:0; }
.spell-spark { visibility:hidden; position:fixed; left:0; top:0; z-index:100; width:var(--grain); height:var(--grain); pointer-events:none; border-radius:50%; background:currentColor; box-shadow:0 0 0 1px #b87919,0 0 4px currentColor; }
#drop-target { position:fixed; inset:12px; z-index:200; display:grid; place-items:center; pointer-events:none; background:#231a3bbd; color:white; border:2px dashed var(--accent); border-radius:12px; font-weight:600; }
#drop-target[hidden] { display:none; }
#drop-dialog { width:min(540px,94vw); }
.drop-body,#drop-dialog form { padding:12px var(--dialog-inset); }
#drop-dialog form { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; border-top:1px solid var(--edge); }
#drop-preview { height:clamp(150px,33vh,300px); display:grid; place-items:center; overflow:hidden; border-radius:6px; background:#24232d; }
#drop-preview img,#drop-preview canvas { position:static; max-width:100%; max-height:100%; object-fit:contain; }
#drop-details { padding-top:8px; overflow-wrap:anywhere; color:var(--ink); }
#designer-shell { height:100vh; height:100dvh; display:flex; flex-direction:column; }
#left-section { display:flex; flex-direction:column; min-height:0; min-width:0; }
#header { --header-height:46px; --logo-size:20px; height:var(--header-height); flex:none; gap:8px; padding:0 8px 0 calc((var(--header-height) - var(--logo-size)) / 2); }
#header #augmenta-link-logo-img { width:var(--logo-size); height:var(--logo-size); }
#augmenta-link-logo a, #augmenta-link-logo img { display:block; }
#augmenta-link-logo a:hover img { filter:drop-shadow(0 0 3px var(--accent)); }
@media (prefers-reduced-motion:no-preference) {
  #augmenta-link-logo img { transition:transform 160ms ease-out, filter 160ms ease-out; }
  #augmenta-link-logo a:hover img { transform:scale(1.1); }
}
#inspector .sensor-select:enabled:hover,
:is(#inspector, .config-dialog) input[type=number]:enabled:not([readonly]):hover,
:is(#inspector, .config-dialog) .transform-number:hover input[type=number]:enabled:not([readonly]) {
  background-color:#f5f1fc;
  border-color:var(--accent-strong-hover);
  box-shadow:0 0 0 1px var(--accent-strong-hover);
}
.sensor-color:enabled:is(:hover,:focus-visible) { --swatch-border:2px solid var(--accent-strong); }
.sensor-profile-row { gap:8px; }
.sensor-profile-row label { flex:0 1 auto; min-width:0; overflow-wrap:anywhere; }
.sensor-profile-row .sensor-select { min-width:0; }
#header-buttons { flex:none; align-items:center; }
#header-buttons > .button { width:auto; min-width:0; height:30px; margin:0; padding:0 16px; gap:5px; white-space:nowrap; }
#header-buttons > .button :is(.main-icon,.secondary-icon) { width:16px; height:16px; padding:0; }
#viewport { flex:1; min-height:0; overflow:hidden; }
@media(max-width:1300px) {
  #header { gap:6px; }
  #header-buttons>.button { padding:0 6px; }
}
@media(max-width:740px), (max-height:500px) and (max-width:960px) {
  #designer-version,#designer-beta { display:none; }
  #viewport { --viewport-inset:6px; }
  #header-buttons, #viewport-buttons { gap:4px; }
  #viewport-buttons .viewport-toggle { padding:3px 5px; font-size:11px; }
  #website-title { font-size:13px; }
  #right-section { width:min(365px,45%); }
  #left-section { flex:1; }
}
@media(max-width:740px) and (orientation:portrait), (max-width:560px) {
  #left-section,#right-section { width:100%; min-width:0; }
  #right-section { min-height:0; }
  #inspector { height:auto; min-height:100%; }
  #header { --header-height:42px; }
  #viewport-buttons #coverage-section { font-size:10px; }
}
@media(prefers-reduced-motion:reduce) {
  .view-navigation *, .view-navigation *::before { transition:none !important; }
}

@media(max-width:1300px) {
  #contact-button p { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #header-buttons #contact-button { width:32px; }
}

@media (max-width:440px), (min-width:561px) and (max-width:900px) {
  #header-buttons > .button { width:32px; }
  #header-buttons > .button p { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
}

.viewport-bottom { position:absolute; bottom:var(--viewport-inset); left:0; right:0; display:grid; gap:6px; pointer-events:none; }
.viewport-bottom #viewport-buttons { position:static; }
#project-file-name:empty { display:none; }
#project-file-name { justify-self:start; box-sizing:border-box; padding-left:2px; margin-left:var(--viewport-inset); max-width:calc(100% - 2 * var(--viewport-inset)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; pointer-events:none; font:400 12px/1.4 var(--ui-font); color:#eeeaf4; text-shadow:0 1px 3px #17151e,0 0 5px #17151e; }
:is(#scene-choices,#scene-geometry) { --muted:#52667b; display:grid; gap:10px; margin:10px 0; }
:is(#scene-choices,#scene-geometry) fieldset { min-width:0; margin:0; padding:0; border:0; }
:is(#scene-choices,#scene-geometry) legend { margin-bottom:4px; font:550 13px/1.4 var(--ui-font); }
:is(#scene-choices,#scene-geometry) .config-segments label { display:grid; min-width:0; font:550 13px/1.4 var(--ui-font); }

#drop-hint:not([hidden]) { display:flex; align-items:center; gap:10px; overflow:hidden; pointer-events:auto; animation:drop-tip-life 5.5s linear both; }
#drop-hint button { background:transparent; border:0; border-radius:4px; color:inherit; font:20px/1 system-ui; padding:3px 6px; cursor:pointer; }
#drop-hint button:hover { background:#ffffff25; }
#drop-hint::after { content:""; position:absolute; inset:auto 0 0; height:2px; background:#c7b2ed; transform-origin:left; animation:drop-tip-time 5.5s linear both; }
@keyframes drop-tip-time { to { transform:scaleX(0); } }
@keyframes drop-tip-life { 0%,100% { opacity:0; } 4%,91% { opacity:1; } }
@media(prefers-reduced-motion:reduce) { #drop-hint:not([hidden]),#drop-hint::after { animation:none; } #drop-hint::after { display:none; } }
#drop-preview.orbit-preview canvas { display:block; width:100%; height:100%; cursor:grab; touch-action:none; }
#drop-preview.orbit-preview canvas:active { cursor:grabbing; }

/* Keep the summary, tracking settings and primary action in the same reading order. */
#inspector > #scene-infos { gap:12px; padding:12px; }
#inspector > #sensors-infos { padding:10px 12px; }
#scene-settings-title {
  display:flex; align-items:center; gap:8px; min-height:34px; padding:0 8px;
  border-radius:5px; list-style:none; font:600 15px/1.35 var(--ui-font);
}
#scene-settings-title::-webkit-details-marker { display:none; }
#scene-settings-title::before {
  content:""; width:6px; height:6px; border:solid currentColor; border-width:0 1.5px 1.5px 0;
  transform:rotate(-45deg); transition:transform .15s ease;
}
.scene-settings[open] #scene-settings-title::before { transform:rotate(45deg); }
#scene-settings-title:hover { background:#81768d14; }
#scene-size-title { font-size:13px; font-weight:500; font-variant-numeric:tabular-nums; }
.scene-settings[open] > summary { margin-bottom:8px; }
.scene-settings .scene-dimensions,.scene-settings .setup-fields {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; margin:8px 0 0;
}
.scene-settings label { min-width:0; }
.scene-settings :is(.scene-dimensions,.setup-fields) label {
  display:grid; align-items:start; gap:4px; font:500 12px/1.4 var(--ui-font);
}
.scene-settings .transform-number { width:100%; max-width:none; }
#inspector .scene-settings input[type=number] { height:28px; }
.scene-settings .setup-fields:not(:has(label:not(.hidden))) { display:none; }
#scene-choices {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto minmax(18px,auto) auto;
  align-items:start; gap:8px 12px; margin:0;
}
#scene-choices legend { font-size:12px; font-weight:500; line-height:16px; margin:0 0 4px; }
#scene-surface-choices { grid-area:1/1; }
#scene-precision-choices,#scene-overlap-choices { grid-area:1/2; }
#sensor-height-detail { grid-area:2/1/3/-1; font:500 12px/18px var(--ui-font); }
#sensor-height-detail output { font-variant-numeric:tabular-nums; }
#scene-choices #open-wizard-button {
  grid-column:1/-1; grid-row:3; width:100%; min-height:36px; height:auto; margin:0;
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  border:0; border-radius:6px; font:600 13px/1.4 var(--ui-font);
}
#open-wizard-button .main-icon { padding:0; width:16px; height:16px; }
#scene-choices .config-segments { padding:0; background:transparent; }
#scene-choices .config-segments label { cursor:default; }
#scene-choices .config-segments label:has(input:not(:checked)) { display:none; }
#scene-choices .config-segments input:checked + span {
  display:flex; flex-direction:row; justify-content:flex-start; gap:6px; align-items:center;
  min-height:38px; padding:0; background:transparent; box-shadow:none; color:inherit;
  font:550 13px/1.35 var(--ui-font);
}
#drop-dialog .file-preview { --wizard-bar-height:40px; margin:0; min-height:0; grid-template-rows:auto auto; }
.file-preview #drop-preview { border-radius:0; }
/* Localized captions may be longer; keep native controls and the existing layout. */
#website-title-container {
  flex:1; min-width:0; display:grid; align-items:center; container-type:inline-size;
  grid-template-columns:minmax(0,1fr) minmax(0,max-content) minmax(0,1fr);
}
#website-title { grid-column:2; text-align:center; align-self:baseline; }
#designer-version { grid-column:3; justify-self:start; align-self:baseline; }
#designer-release { grid-column:3; justify-self:start; align-self:baseline; display:inline-flex; align-items:baseline; white-space:nowrap; }
@container (max-width:300px) { #designer-release { display:none; } }
#website-title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.language-control { position:relative; align-self:center; display:inline-flex; align-items:center; justify-content:center; gap:5px; box-sizing:border-box; width:44px; height:30px; border:1px solid #8885; border-radius:5px; color:#eee; font:600 12px/1 var(--ui-font); }
.language-control::after { content:""; width:5px; height:5px; border:solid currentColor; border-width:0 1px 1px 0; transform:translateY(-1px) rotate(45deg); }
.language-control select { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.language-control:hover { background:#ffffff12; }
html:not([data-pointer-focus]) .language-control:has(select:focus-visible) { outline:2px solid var(--accent); outline-offset:2px; }
.language-control option { color:#222; background:#fff; }
html:lang(ja) { --ui-font:Inter, "Noto Sans CJK JP", "Yu Gothic", sans-serif; }
html:lang(ko) { --ui-font:Inter, "Noto Sans CJK KR", "Malgun Gothic", sans-serif; }
html:lang(zh-Hans) { --ui-font:Inter, "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
html:lang(zh-Hant) { --ui-font:Inter, "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif; }
.config-segments label, .config-steps button { min-width:0; overflow-wrap:anywhere; }
.config-segments .tracking-choice, .config-segments .surface-option { text-align:center; }
.ray-legend-panel { overflow-wrap:anywhere; }
/* Keep native keyboard focus visible, including when a dialog opens from the keyboard. */
html[data-pointer-focus] :is(button, select, summary, a, [tabindex], input[type=radio], input[type=checkbox]):focus,
html[data-pointer-focus] .config-segments input:focus + span,
html[data-pointer-focus] .element-action:focus-within { outline:none; }

/* Keep history actions together, immediately before the file actions. */
.history-actions:not([hidden]) { display:flex; gap:2px; }
.history-actions button {
  display:grid; place-items:center; width:44px; height:44px; padding:0; border:0;
  border-radius:5px; background:transparent; color:#eeeaf4; cursor:pointer;
}
.history-actions svg { color:inherit; width:18px; height:18px; padding:0; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.history-actions button:disabled { color:#807b89; cursor:default; }
.history-actions button:enabled:active { background:#ffffff24; }
@media (hover:hover) { .history-actions button:enabled:hover { background:#ffffff18; } }
@media (any-pointer:coarse) {
  #header { --header-height:46px; }
}
@media (max-width:395px) {
  #header { height:auto; flex-wrap:wrap; gap:0 8px; padding-block:4px; }
  #website-title-container { min-height:28px; }
  #header-buttons { flex-basis:100%; justify-content:flex-end; }
}

#designer-workspace {
  --panel-width:400px;
  --panel-edge:var(--panel-width);
  position:relative; flex:1; min-height:0; overflow:hidden;
}
#designer-workspace.sidebar-hidden { --panel-edge:0px; }
#designer-workspace #left-section { width:calc(100% - var(--panel-edge)); height:100%; transition:width 220ms ease; }
/* Clip a centered drawing surface while the viewport edge moves. Enlarge it
   before exposing more of the scene, and shrink it after the drawer settles. */
#viewport .scene-render-surface {
  position:absolute; top:0; left:50%; height:100%; transform:translateX(-50%);
  width:calc(100vw - var(--panel-edge)); transition:width 0s linear var(--sidebar-transition-duration);
}
.sidebar-hidden #viewport .scene-render-surface { transition-delay:0s; }
#designer-workspace #right-section {
  position:absolute; inset:0 0 0 auto; width:var(--panel-width); transition:transform 220ms ease;
}
#designer-workspace #inspector { height:auto; min-height:100%; }
.sidebar-hidden #right-section { transform:translateX(100%); }
#sidebar-toggle {
  position:absolute; z-index:20; top:50%; right:var(--panel-width); width:32px; height:64px;
  padding:0 4px; transform:translateY(-50%); border:1px solid rgb(255 255 255 / 38%); border-right:0;
  border-radius:8px 0 0 8px; color:#fff; background:transparent; text-shadow:0 1px 3px #24202e; cursor:pointer;
  font:600 18px/1 var(--ui-font); transition:transform var(--sidebar-transition-duration) ease, background 120ms ease, color 120ms ease, opacity 120ms ease-out;
}
.sidebar-hidden #sidebar-toggle { transform:translate(var(--panel-width), -50%); }
#sidebar-toggle:hover { background:rgb(255 255 255 / 12%); }
.sidebar-handle-idle #sidebar-toggle { opacity:0; pointer-events:none; transition-duration:220ms,120ms,120ms,1200ms; }
@media (max-width:900px), (pointer:coarse) and (max-width:1100px) {
  #designer-workspace { --view-height:58%; }
  /* Avoid an unnecessary transformed/composited WebGL surface on mobile Safari. */
  #viewport .scene-render-surface { inset:0; width:100%; height:100%; transform:none; transition:none; }
  #viewport .scene-render-surface > canvas { top:0; left:0; display:block; touch-action:none; }
  #designer-workspace.sidebar-hidden { --view-height:100%; }
  #designer-workspace #left-section { width:100%; height:var(--view-height); transition:none; }
  #designer-workspace #right-section { inset:var(--view-height) 0 0; width:100%; transition:none; }
  .sidebar-hidden #right-section { display:none; }
  #sidebar-toggle, .sidebar-handle-idle #sidebar-toggle {
    top:var(--view-height); right:12px; width:42px; height:28px; border:1px solid rgb(255 255 255 / 38%);
    border-radius:999px;  font-size:14px; opacity:1; pointer-events:auto;
  }
  #designer-workspace.sidebar-hidden #sidebar-toggle { top:auto; bottom:max(12px,env(safe-area-inset-bottom)); transform:none; }
}
#designer-workspace.restoring-sidebar * { transition:none !important; }
@media (prefers-reduced-motion:reduce) {
  #designer-workspace :is(#left-section,#right-section,#sidebar-toggle,.scene-render-surface) { transition:none; }
}

.floor-turn-feedback { position:absolute; inset:0; width:100%; height:100%; padding:0; letter-spacing:normal; pointer-events:none; }
.floor-turn-feedback .turn-sector { fill:rgb(139 196 255 / 23%); stroke:#b4d8ff; stroke-width:1; }
.floor-turn-feedback .turn-start { fill:none; stroke:white; stroke-width:2; stroke-dasharray:4 3; }
.floor-turn-feedback .turn-end { fill:none; stroke:#ffdf79; stroke-width:2; }
.floor-turn-feedback text { font:600 13px var(--ui-font); fill:white; stroke:#272432; stroke-width:4; stroke-linejoin:round; paint-order:stroke; text-anchor:middle; dominant-baseline:central; }
