.dse-overlay{--dse-brand:var(--brand,#356aff);--dse-ink:var(--ink,#17315e);--dse-muted:var(--muted,#7186a7);--dse-line:var(--line,#dce6f3);--dse-surface:var(--surface,#fff);position:absolute;inset:0;z-index:20;display:grid;place-items:start center;padding:14px;isolation:isolate;color:var(--dse-ink)}.dse-overlay *{box-sizing:border-box}.dse-backdrop{position:absolute;inset:0;z-index:-1;background:#17345824;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);border-radius:inherit}.dv-stage:has(.dse-overlay),.dv-stage.has-surface-editor{min-height:620px;overflow:visible}.dse-shell{width:min(100%,590px);max-height:calc(100% - 1px);border:1px solid #d6e2f2;border-radius:20px;background:var(--dse-surface);box-shadow:0 20px 70px #15305824,0 3px 12px #15305812;display:flex;flex-direction:column;overflow:hidden;position:relative}.dse-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:17px 20px 14px;border-bottom:1px solid var(--dse-line);flex:none}.dse-header-leading{display:flex;align-items:center;gap:13px}.dse-tooth-number{display:grid;place-items:center;flex:none;width:45px;height:50px;border:1px solid #cddcff;border-radius:14px;background:#edf3ff;color:var(--dse-brand);font-size:20px;font-weight:700;letter-spacing:-.4px}.dse-eyebrow{display:block;color:var(--dse-muted);font-size:8px;font-weight:650;letter-spacing:1.3px;margin-bottom:4px}.dse-header h3{font-size:18px;line-height:1.2;letter-spacing:-.4px;font-weight:650;margin:0}.dse-header p{font-size:10px;line-height:1.5;color:var(--dse-muted);margin:5px 0 0}.dse-close{display:grid;place-items:center;appearance:none;width:36px;height:36px;border:0;border-radius:10px;color:var(--dse-muted);background:transparent;cursor:pointer;flex:none}.dse-close:hover{background:#f0f5fc;color:var(--dse-ink)}.dse-body{padding:0 19px 13px;overflow:auto;min-height:0;overscroll-behavior:contain}.dse-viewport{position:relative;height:238px;overflow:hidden;background:radial-gradient(ellipse at 50% 44%,#fff 0,#f6f9fe 57%,#eef4fc 100%);border-radius:0 0 14px 14px;margin:0 -2px 10px}.dse-viewport canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab;outline-offset:-4px}.dse-viewport canvas:focus-visible{outline:2px solid var(--dse-brand)}.dse-model-tag{display:flex;align-items:center;gap:5px;position:absolute;left:12px;top:12px;font-size:8px;font-weight:550;color:#7790b0;pointer-events:none}.dse-reset{display:flex;align-items:center;gap:6px;position:absolute;right:8px;top:6px;appearance:none;border:0;background:transparent;color:var(--dse-muted);font:inherit;font-size:9px;min-height:36px;padding:0 8px;cursor:pointer;border-radius:8px}.dse-reset:hover{background:#eaf1fd;color:var(--dse-brand)}.dse-loading,.dse-fallback{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:11px;background:#f5f8fe;color:var(--dse-ink);text-align:center;padding:22px}.dse-loading[hidden],.dse-fallback[hidden]{display:none}.dse-loading>span,.dse-fallback>span{display:grid;place-items:center;width:50px;height:50px;border-radius:16px;border:1px solid #dbe5f5;color:var(--dse-brand);background:white}.dse-loading strong,.dse-fallback strong{font-size:13px;font-weight:650}.dse-loading small,.dse-fallback small{font-size:10px;line-height:1.6;color:var(--dse-muted);max-width:240px}.dse-unavailable .dse-canvas-hint,.dse-unavailable .dse-model-tag{display:none}.dse-canvas-hint{position:absolute;bottom:10px;left:0;right:0;text-align:center;color:#8296b3;font-size:8px;pointer-events:none}.dse-hover-label{position:absolute;left:50%;bottom:33px;transform:translateX(-50%);background:#fffef3ed;border:1px solid #d6e2f2;color:#476488;font-size:10px;font-weight:600;border-radius:20px;padding:6px 10px;box-shadow:0 2px 8px #1f426b10;pointer-events:none;white-space:nowrap}.dse-hover-label[hidden]{display:none}.dse-tool-row{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:14px}.dse-selection-count{color:var(--dse-muted);font-size:9px;line-height:1.5}.dse-controls{display:flex;align-items:center;gap:1px;flex:none;padding:2px;background:#f2f6fc;border:1px solid #e3ebf5;border-radius:10px}.dse-controls button{appearance:none;display:grid;place-items:center;width:31px;height:32px;border:0;background:transparent;border-radius:7px;color:#6681a6;cursor:pointer;padding:0}.dse-controls button:hover{background:white;color:var(--dse-brand);box-shadow:0 2px 5px #2344720b}.dse-controls button:disabled,.dse-reset:disabled{opacity:.4;cursor:default}.dse-controls>i{width:1px;height:17px;background:#dce5f1;margin-inline:3px}.dse-arrow-up,.dse-arrow-down{display:flex}.dse-arrow-up{transform:rotate(-90deg)}.dse-arrow-down{transform:rotate(90deg)}.dse-face-chips{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.dse-face-chip{appearance:none;position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;min-height:69px;border:1px solid var(--dse-line);border-radius:11px;background:var(--dse-surface);color:var(--dse-muted);font:inherit;cursor:pointer;padding:9px 5px;transition:background .15s,border-color .15s,color .15s}.dse-face-chip:hover{border-color:#9ab7f5;background:#f7faff}.dse-chip-code{display:grid;place-items:center;width:24px;height:24px;border-radius:7px;background:#f1f5fc;border:1px solid #e4ebf5;font-size:12px;font-weight:700;line-height:1}.dse-face-chip>span:nth-child(2){font-size:9px;font-weight:550;line-height:1.2}.dse-face-chip>i{position:absolute;top:5px;right:5px;display:grid;place-items:center;width:13px;height:13px;border-radius:4px;font-style:normal}.dse-face-chip.is-selected{color:var(--dse-brand);border-color:#80a6ff;background:#edf3ff}.dse-face-chip.is-selected .dse-chip-code{color:#fff;background:var(--dse-brand);border-color:var(--dse-brand)}.dse-face-chip.is-selected>i{background:var(--dse-brand);color:white}.dse-note{color:var(--dse-muted);font-size:8px;line-height:1.65;margin:11px 0 0}.dse-error{display:flex;align-items:flex-start;gap:7px;padding:10px;border:1px solid #efc5cb;border-radius:9px;background:#fff3f4;color:#a74655;font-size:10px;line-height:1.6;margin:10px 0 0}.dse-error>svg{flex:none;margin-top:1px}.dse-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 19px;border-top:1px solid var(--dse-line);background:#fbfcff;flex:none}.dse-footer>div{display:flex;align-items:center;gap:7px}.dse-footer-hint{font-size:8px;line-height:1.5;color:var(--dse-muted);max-width:160px}.dse-cancel,.dse-save,.dse-remove{appearance:none;display:flex;align-items:center;justify-content:center;gap:6px;border-radius:9px;font:inherit;font-size:10px;font-weight:550;min-height:39px;padding:9px 12px;cursor:pointer;white-space:nowrap}.dse-cancel{background:white;color:var(--dse-muted);border:1px solid var(--dse-line)}.dse-save{background:var(--dse-brand);color:white;border:1px solid var(--dse-brand);box-shadow:0 3px 7px #356aff17}.dse-remove{border:0;background:transparent;color:#ae5362;padding-inline:0;font-size:9px}.dse-remove:hover{color:#8e2e3e}.dse-save:hover{filter:brightness(.96)}.dse-cancel:hover{color:var(--dse-ink)}.dse-shell button:focus-visible{outline:3px solid #91b5ff;outline-offset:2px}.dse-viewport:has(.dse-fallback:not([hidden])) canvas{visibility:hidden}
@media(max-width:600px){.dse-overlay{padding:8px}.dv-stage:has(.dse-overlay),.dv-stage.has-surface-editor{min-height:620px}.dse-shell{border-radius:16px}.dse-header{padding:14px 13px 12px;gap:8px}.dse-header-leading{gap:10px}.dse-tooth-number{width:40px;height:44px;border-radius:12px;font-size:18px}.dse-header h3{font-size:17px}.dse-header p{font-size:9px}.dse-eyebrow{font-size:7px;letter-spacing:1px}.dse-close{width:34px;height:34px}.dse-body{padding-inline:12px}.dse-viewport{height:226px}.dse-tool-row{gap:6px;flex-wrap:wrap;margin-bottom:12px}.dse-selection-count{font-size:8px;flex:1}.dse-controls button{width:36px;height:38px}.dse-controls>i{margin-inline:1px}.dse-face-chips{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.dse-face-chip{min-height:52px;padding:8px 6px;border-radius:9px;gap:5px}.dse-chip-code{font-size:14px;width:26px;height:26px}.dse-face-chip>span:nth-child(2){font-size:10px}.dse-face-chip>i{width:11px;height:11px;top:4px;right:3px}.dse-face-chip>i>svg{width:9px;height:9px}.dse-note{font-size:8px}.dse-footer{padding:12px;flex-wrap:wrap;gap:8px}.dse-footer-hint{font-size:7px;max-width:110px}.dse-footer>div{margin-left:auto;gap:5px}.dse-cancel,.dse-save{font-size:9px;min-height:40px;padding-inline:10px}.dse-remove{font-size:8px}.dse-remove>svg{width:13px;height:13px}}
@media(max-width:380px){.dse-controls{margin-left:auto}.dse-selection-count{min-width:100%;text-align:center}.dse-tool-row{justify-content:center}.dse-controls{margin-inline:auto}.dse-footer-hint{display:none}.dse-footer>div{flex:1;justify-content:flex-end}.dse-remove{min-height:32px}.dse-face-chips{gap:5px}.dse-face-chip>span:nth-child(2){font-size:10px}.dse-body{padding-inline:10px}}
html[data-theme=dark] .dse-overlay{--dse-surface:#17263c;--dse-line:#30435f}html[data-theme=dark] .dse-shell{border-color:#385170}html[data-theme=dark] .dse-tooth-number,html[data-theme=dark] .dse-face-chip.is-selected{background:#223c61;border-color:#4675b9}html[data-theme=dark] .dse-viewport{background:radial-gradient(ellipse at 50% 44%,#2b405c,#1b2c44)}html[data-theme=dark] .dse-controls,html[data-theme=dark] .dse-chip-code{background:#22344e;border-color:#354967}html[data-theme=dark] .dse-footer{background:#152338}html[data-theme=dark] .dse-cancel{background:#1d304b}html[data-theme=dark] .dse-loading,html[data-theme=dark] .dse-fallback{background:#1c2f48}html[data-theme=dark] .dse-loading>span,html[data-theme=dark] .dse-fallback>span{background:#263d5b;border-color:#415b7e}html[data-theme=dark] .dse-face-chip:hover{background:#213953}html[data-theme=dark] .dse-error{background:#3f2632;border-color:#713e4c;color:#e5a0ac}
@media(prefers-reduced-motion:reduce){.dse-face-chip{transition:none}}

/* Keep the complete arch visible beside the floating editor when the stage,
   rather than the overall browser viewport, has enough horizontal room. */
.dv-stage.has-surface-editor{container-type:inline-size;container-name:dental-surface-stage}
@container dental-surface-stage (min-width:620px){
  .dse-overlay{place-items:center end;padding:18px}
  .dse-shell{width:min(64%,440px);max-height:calc(100% - 1px)}
  .dse-backdrop{background:linear-gradient(90deg,#f8fbff0a 0%,#f8fbff20 38%,#eaf1fb66 100%);backdrop-filter:none;-webkit-backdrop-filter:none}
  .dental-volume .dv-stage.has-surface-editor>canvas{transform:translateX(-27%) scale(.68);transform-origin:50% 50%;opacity:.68;filter:blur(.2px)}
  .dental-volume .dv-stage.has-surface-editor>.dv-labels{transform:translateX(-27%) scale(.68);transform-origin:50% 50%;opacity:.76}
  .dental-volume .dv-stage.has-surface-editor>.dv-stage-top{opacity:.65}
  .dental-volume .dv-stage.has-surface-editor>.dv-stage-top .dv-reset{visibility:hidden}
  .dental-volume .dv-stage.has-surface-editor>.dv-orientation{opacity:0}
  html[data-theme=dark] .dse-backdrop{background:linear-gradient(90deg,#1422380a,#14223840)}
}

/* Keep the editing controls inside the visible viewport, including landscape phones. */
.dse-shell{max-height:min(calc(100% - 1px),calc(100dvh - 90px))}
@media(max-width:600px){.dv-stage:has(.dse-overlay),.dv-stage.has-surface-editor{min-height:660px}}
.dv-stage.has-surface-editor{overflow:hidden}
