:root {
  color-scheme: light;
  --ink: #203b3b;
  --muted: #6f807b;
  --accent: #27665b;
  --line: #dce3db;
  --paper: #fbfcf8;
  --soft: #edf2e9;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f4f5f1; color: var(--ink); }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; text-decoration: none; }
button, a, input { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-header { position: relative; height: 80px; z-index: 20; background: #ffffffde; backdrop-filter: blur(12px); border-bottom: 1px solid #e5e7eb; color: #374151; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; max-width: 1280px; margin: auto; padding: 0 32px; }
.brand { display: flex; align-items: center; gap: 8px; color: #1d4ed8; font-size: 20px; font-weight: 700; letter-spacing: -.5px; white-space: nowrap; }
.brand img { display: block; width: 36px; height: 36px; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.site-nav a:hover, .site-menu a:hover { color: #1d4ed8; background: #f3f4f6; }
.site-menu-toggle { display: none; padding: 12px; width: 48px; height: 48px; border: 0; border-radius: 8px; color: #4b5563; background: transparent; }
.site-menu-toggle svg { width: 24px; height: 24px; }
.menu-close-icon, .site-menu-toggle[aria-expanded='true'] .menu-open-icon { display: none; }
.site-menu-toggle[aria-expanded='true'] .menu-close-icon { display: block; }
.site-menu { position: absolute; top: 100%; left: 0; right: 0; padding: 12px max(16px, env(safe-area-inset-right)); background: #fffffff5; border-bottom: 1px solid #e5e7eb; box-shadow: 0 12px 24px #17255414; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.site-menu a { display: block; padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 24px; padding: 24px 28px; height: calc(100dvh - 80px); min-height: 600px; max-width: 1920px; margin: auto; }
.inspector { overflow-y: auto; padding: 0 16px 4px 0; scrollbar-width: thin; scrollbar-color: #c6d2c5 transparent; }
.mode-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #e9eee5; margin-bottom: 25px; gap: 3px; }
.mode-switch button { width: 50%; border: 0; background: transparent; padding: 11px 5px; font-size: 11px; font-weight: 550; border-radius: 6px; color: #6a7b70; transition: background .18s; }
.mode-switch button.active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 5px #314b3210; }
.section-label { display: flex; justify-content: space-between; gap: 8px; font-size: 8px; letter-spacing: 1.15px; font-weight: 650; color: var(--muted); margin: 0 0 14px; }
.part-list { display: grid; gap: 4px; }
.part-card { display: flex; width: 100%; align-items: center; text-align: left; gap: 13px; border: 1px solid transparent; border-radius: 8px; padding: 15px 11px; background: transparent; transition: background .18s, border-color .18s; }
.part-card:hover { background: #edf1e9; }
.part-card.active { background: var(--paper); border-color: #d3ddd0; }
.part-number { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #e7eddf; font-size: 10px; color: #728369; font-variant-numeric: tabular-nums; }
.part-card.active .part-number { background: var(--accent); color: white; }
.part-card > span:nth-child(2) { flex: 1; }
.part-card strong { display: block; font-size: 12px; font-weight: 550; }
.part-card small { display: block; font-size: 10px; line-height: 1.5; color: var(--muted); margin-top: 4px; }
.part-card svg { width: 12px; height: 12px; color: #98a690; }
.part-story { padding: 17px 4px 12px; min-height: 115px; }
.material-label { color: var(--accent); font-size: 8px; font-weight: 650; letter-spacing: 1.8px; }
.part-story p { color: #68796e; font-size: 11px; line-height: 1.8; margin: 8px 0; }
.assembly-control { border-top: 1px solid var(--line); padding-top: 21px; }
.control-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; margin-bottom: 12px; }
.control-label label { display: flex; gap: 8px; align-items: center; }
.control-label output { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
input[type='range'] { display: block; width: 100%; margin: 0; height: 22px; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type='range']::-webkit-slider-runnable-track { height: 3px; background: #ccd7c4; border-radius: 2px; }
input[type='range']::-moz-range-track { height: 3px; background: #ccd7c4; border-radius: 2px; }
input[type='range']::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; background: var(--accent); border: 3px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 1px #aab9a4; margin-top: -6px; }
input[type='range']::-moz-range-thumb { width: 12px; height: 12px; background: var(--accent); border: 3px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 1px #aab9a4; }
.range-ends { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin: 6px 0 19px; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px 12px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 550; transition: background .2s; min-height: 44px; }
.primary-button:hover { background: #1d5148; }
.primary-button svg { width: 15px; height: 15px; }
.quiet-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: transparent; font-size: 11px; min-height: 42px; }
.quiet-button:hover { background: var(--soft); }
.quiet-button svg { width: 15px; height: 15px; }
.educational-note { color: #849080; font-size: 9px; line-height: 1.8; padding: 20px 3px 0; margin: 0; }
.educational-note a { display: inline-block; margin-top: 9px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.stage { position: relative; min-width: 0; overflow: hidden; background: radial-gradient(ellipse at 49% 42%, #ffffff 0, #f6f7f0 44%, #edf0e5 100%); border: 1px solid #dee5d6; border-radius: 12px; isolation: isolate; }
#app { position: absolute; inset: 20px 12px 106px; }
#app canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#app canvas:active { cursor: grabbing; }
.anatomy-legend { position: absolute; bottom: 117px; left: 22px; right: 22px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 17px; pointer-events: none; font-size: 9px; color: #647765; }
.anatomy-legend > span { display: flex; align-items: center; gap: 6px; padding: 5px 0; }
.view-toolbar { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; border: 1px solid #dbe2d5; border-radius: 10px; background: #fcfdf9ed; box-shadow: 0 5px 15px #42583b05; white-space: nowrap; z-index: 2; }
.view-presets { display: flex; align-items: center; gap: 2px; }
.view-presets button { border: 0; background: transparent; border-radius: 6px; padding: 12px 10px; font-size: 10px; color: #6f8068; }
.view-presets button:hover, .icon-button:hover { background: #edf2e7; }
.view-presets button.active, .icon-button[aria-pressed='true'] { background: #e8eddf; color: #34562e; }
.toolbar-divider { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.icon-button { width: 36px; height: 36px; padding: 9px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; }
.icon-button svg { width: 17px; height: 17px; }
.stage-footer { position: absolute; bottom: 23px; left: 27px; right: 27px; display: flex; justify-content: space-between; gap: 12px; font-size: 9px; color: #87917e; }
.mouse-symbol { font-size: 13px; margin-right: 5px; }
.hint-separator { margin: 0 5px; }
.stage-index { font-size: 8px; letter-spacing: 1.5px; }
#partLabels { position: absolute; inset: 0; pointer-events: none; }
#partLabels button { position: absolute; display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 5px; border: 1px solid #d0dbc7; background: #fcfdf8eb; font-size: 9px; color: #738267; pointer-events: auto; white-space: nowrap; transition: opacity .15s; box-shadow: 0 3px 10px #395c2410; }
#partLabels button::before { content: ''; position: absolute; width: 25px; height: 1px; background: #adc29c; left: -26px; }
#partLabels button span { color: #405b34; font-size: 10px; }
#partLabels button.active { border-color: #729865; background: #f3f7ea; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 13px; background: #f4f6ef; z-index: 4; }
#loading.hide { display: none; }
#loading strong { font-size: 14px; font-weight: 500; }
#loading p { color: var(--muted); font-size: 11px; margin: 0; }
.spin { width: 28px; height: 28px; border: 1px solid #ced9c5; border-top-color: #47773f; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
#loadError { position: absolute; inset: 0; z-index: 5; background: var(--paper); display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 30px; }
#loadError h2 { font-size: 25px; font-weight: 450; }
#loadError p { font-size: 12px; line-height: 1.7; }
#loadError button { max-width: 220px; margin: 20px 0; }
#loadError a { text-decoration: underline; font-size: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.panel-head h2 { font-size: 13px; font-weight: 550; margin: 0; }
.collapse-btn { border: 0; background: none; font-size: 18px; width: 32px; height: 32px; }
.panel-toggle { display: none; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 14px 0; background: none; border: 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.panel-toggle span { margin-left: auto; }
.collapsed > .panel-toggle { display: flex; }
#ctrlWrap.collapsed #ctrlPanel, #infoWrap.collapsed #info { display: none; }
.segmented { display: flex; gap: 3px; border: 1px solid var(--line); padding: 3px; border-radius: 7px; }
.segmented button { flex: 1; border: 0; background: transparent; font-size: 10px; border-radius: 4px; padding: 10px 4px; color: var(--muted); }
.segmented button.active { background: #dfe8d7; color: #3a5d35; }
.facial-context { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #f9fbf5; }
.facial-context button { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; padding: 3px 0; gap: 12px; background: transparent; text-align: left; font-size: 10px; }
.facial-context button i { display: block; position: relative; flex-shrink: 0; width: 29px; height: 17px; border-radius: 10px; background: #c7d1c3; transition: background .15s; }
.facial-context button i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: white; transition: transform .15s; }
.facial-context button[aria-pressed='true'] i { background: var(--accent); }
.facial-context button[aria-pressed='true'] i::after { transform: translateX(12px); }
.facial-context p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.anatomy-presets { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 5px; margin-bottom: 12px; }
.anatomy-presets button { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 7px; padding: 12px 3px; font-size: 9px; line-height: 1.4; }
.anatomy-presets button:hover { border-color: #aabca7; }
.anatomy-presets button.active { border-color: var(--accent); background: #e4eee4; color: #1d5c51; }
#gumsWrap { padding-top: 22px; }
.layer-row { margin-bottom: 11px; }
.layer-row .control-label { margin-bottom: 2px; }
.swatch { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.gum { background: #d39397; }.bone { background: #c5b68d; }.nerve { background: #d6ad4e; }.canal { background: #449caa; }
.layer-explanation { color: var(--muted); font-size: 9px; line-height: 1.7; margin: 9px 0 14px; }
#revealRoots { width: 100%; margin-bottom: 24px; }
#toothChart { display: grid; gap: 5px; }
.tooth-row { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; }
.tooth-row button { padding: 9px 0; border: 1px solid #d6dfcf; border-radius: 5px; font-size: 8px; background: #f9fbf5; font-variant-numeric: tabular-nums; }
.tooth-row button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tooth-row button.missing { border-style: dashed; color: #89947f; background: transparent; }
.chart-hint { font-size: 9px; color: var(--muted); line-height: 1.6; }
#removeCtl { margin: 15px 0; display: flex; flex-direction: column; gap: 8px; }
#removeToggle.active { color: #a85351; border-color: #dcbfbb; background: #f8eeea; }
#restoreBtn { display: none; }
body.has-extracted #restoreBtn { display: flex; }
#infoWrap { position: absolute; top: 16px; right: 16px; width: 286px; z-index: 3; pointer-events: auto; }
#infoWrap.collapsed { width: auto; }
#infoFab { padding: 12px 14px; gap: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fcfdf9ed; box-shadow: 0 4px 20px #203b3b0d; }
#info { border: 1px solid #d4dfd3; padding: 12px; margin: 0; border-radius: 12px; background: #fcfdf9f7; box-shadow: 0 12px 32px #203b3b18; backdrop-filter: blur(12px); }
#info .panel-head { margin: 0 0 6px; }
#info .panel-head h2 { font-size: 12px; }
.tooth-summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; column-gap: 8px; align-items: center; margin: 2px 0 10px; }
.tooth-summary .row1 { grid-row: 1 / 3; flex-direction: column; gap: 2px; }
.tooth-summary .fdi { font-size: 25px; line-height: 1; }
.tooth-summary .arch-badge { padding: 2px 4px; font-size: 7px; }
.tooth-summary .name { font-size: 10px; line-height: 1.5; margin: 0; }
.tooth-summary .sub { grid-column: 2; font-size: 8px; margin: 0; }
.tooth-summary #detailBtn { grid-column: 3; grid-row: 1 / 3; width: auto; padding: 8px; margin: 0; font-size: 9px; min-height: 34px; }
.selection-tools { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.selection-tools button { border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 8px; font-size: 10px; min-height: 34px; }
#multiSelectToggle[aria-pressed='true'] { background: var(--accent); color: white; border-color: var(--accent); }
#selectionCount { font-size: 10px; color: var(--muted); margin-left: auto; }
.tooth-panel-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px; }
.tooth-panel-tabs button { flex: 1; min-height: 32px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; }
.tooth-panel-tabs button.active { background: #e4eee4; color: var(--accent); }
#info #cond, #info #treat { margin: 0; }
#info .section-label { margin-bottom: 8px; font-size: 7px; }
#info .cond-btns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
#info .cond-btns button, #info .treat-btns button { padding: 9px 5px; font-size: 10px; min-height: 34px; }
#info .treat-btns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
#selectionActionHint { margin: 10px 0 0; font-size: 9px; line-height: 1.6; color: var(--muted); }
#info.empty .tooth-summary, #info.empty .tooth-panel-tabs, #info.empty .tooth-panel-page, #info.empty #selectionCount, #info.empty #clearSelection, #info.empty #selectionActionHint { display: none; }
#info.empty .row1, #info.empty .name, #info.empty .sub, #info.empty #cond, #info.empty #treat, #info.empty #detailBtn { display: none; }
.placeholder { font-size: 11px; color: var(--muted); line-height: 1.7; display: none; }
#info.empty .placeholder { display: block; }
.row1 { display: flex; align-items: center; gap: 10px; }
.fdi { font-size: 32px; letter-spacing: -1px; }
.arch-badge { font-size: 9px; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); }
.name { font-size: 12px; line-height: 1.6; margin-top: 5px; }
.sub { font-size: 10px; color: var(--muted); margin-top: 3px; }
#cond, #treat { margin-top: 20px; }
.cond-btns, .treat-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.cond-btns button, .treat-btns button { border: 1px solid var(--line); border-radius: 5px; padding: 9px 11px; background: transparent; font-size: 10px; }
.cond-btns button.active { background: #dfe9d7; border-color: #bfcfb3; }
.treat-btns button.active, .treat-btns button[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: white; }
#detailBtn { margin-top: 20px; }
.br-top { font-size: 11px; margin: 15px 0 10px; }
.br-rows { display: grid; gap: 7px; margin-bottom: 9px; }
.br-row { display: flex; align-items: center; justify-content: space-between; font-size: 10px; }
.br-row button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
#extractBar { display: none; position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); align-items: center; gap: 10px; background: #fffaf5; border: 1px solid #e7d8c9; padding: 11px 13px; border-radius: 8px; font-size: 11px; white-space: nowrap; }
body.removing #extractBar { display: flex; }
#extractBar button { border: 0; border-radius: 5px; padding: 10px; font-size: 10px; background: #f0e4da; }
#exExtract { background: #97604e !important; color: white; }
#selectionLabels { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; user-select: none; }
#selectionLabels *, #selectionLabels svg { pointer-events: none; }
#selectionLabels .selection-label-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#selectionLabels .selection-label { position: absolute; top: 0; left: 0; display: flex; align-items: center; justify-content: center; width: 32px; height: 24px; border: 1px solid #4e8777; border-radius: 6px; background: #fcfff9f5; color: #174f43; box-shadow: 0 1px 5px #173e2926, 0 0 0 1px #ffffffa8; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
#selectionLabels .selection-label.is-primary { background: #216452; border-color: #154c3d; color: #fff; font-weight: 750; }
#selectionLabels .selection-label.is-compact { border-radius: 5px; font-size: 10px; }
#selectionLabels .selection-label.is-offscreen { border-style: dashed; }
#selectionLabels .selection-label-leader { stroke: #427d6d; stroke-width: 1; stroke-opacity: .85; vector-effect: non-scaling-stroke; }
#selectionLabels .selection-label-anchor { fill: #27665b; stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; }
#selectionLabels .is-primary .selection-label-leader { stroke: #155440; stroke-width: 1.5; }
#detailBar { display: none; position: absolute; top: 24px; left: 25px; right: 25px; align-items: center; gap: 15px; }
#detailLabel { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; }
#d-fdi { font-weight: 600; }
#d-name { color: var(--muted); }
body.detail #detailBar { display: flex; }
body.detail #removeCtl, body.detail #extractBar, body.detail #detailBtn { display: none; }
#implantPanel { display: none; }
#implantPanel h2 { font-size: 25px; font-weight: 400; letter-spacing: -1px; }
.ip-step { font-size: 12px; color: var(--accent); }
.ip-sub { font-size: 11px; color: var(--muted); line-height: 1.8; margin-bottom: 25px; }
.ip-part { margin-bottom: 20px; }
.ip-btns { display: flex; gap: 8px; margin-top: 12px; }
.ip-btns button { flex: 1; font-size: 10px; }
body.implant #implantPanel { display: block; }
body.implant #anatomyStudy, body.implant #implantStudy, body.implant #detailBar, body.implant #selectionLabels, body.implant #anatomyLegend, body.implant #infoWrap { display: none; }
body[data-mode='implant'] #anatomyStudy, body[data-mode='implant'] #detailBar, body[data-mode='implant'] #selectionLabels, body[data-mode='implant'] #anatomyLegend, body[data-mode='implant'] #infoWrap { display: none; }
body[data-mode='anatomy'] #implantStudy, body[data-mode='anatomy'] #partLabels { display: none; }
body[data-mode='anatomy'] #app { inset: 20px 12px 146px; }
body.detail #anatomyLegend { display: none; }
body.detail[data-mode='anatomy'] #app, body.implant[data-mode='anatomy'] #app { inset: 75px 12px 106px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noscript { position: fixed; inset: 80px 0 0; z-index: 10; background: var(--paper); display: grid; place-content: center; padding: 30px; gap: 20px; }
.noscript a { text-decoration: underline; }
.workspace:fullscreen { background: #f4f5f1; width: 100%; max-width: none; height: 100%; }
.mobile-console { display: none; }
@media (max-width: 1279px), (pointer: coarse) and (min-width: 761px) {
  :root { --atlas-header-height: calc(64px + env(safe-area-inset-top)); }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .site-header { height: var(--atlas-header-height); padding-top: env(safe-area-inset-top); }
  .site-header-inner { padding: 0 20px; }.brand { font-size: 18px; }
  .site-nav a { padding: 10px 9px; font-size: 12px; }
  .workspace { height: calc(100dvh - var(--atlas-header-height)); min-height: 0; grid-template-columns: 260px minmax(0,1fr); gap: 14px; padding: 14px; overflow: hidden; }
  .inspector { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; }
  .stage { min-height: 0; height: 100%; }
  .view-presets button { padding: 12px 7px; font-size: 9px; }
  .icon-button { width: 31px; height: 35px; padding: 7px; }
  .toolbar-divider { margin: 0 3px; }.stage-index { display: none; }.stage-footer { justify-content: center; }
  #infoWrap { right: 10px; top: 10px; width: 260px; }
}
@media (max-width: 1023px) {
  .site-nav { display: none; }.site-menu-toggle { display: grid; place-items: center; }
  .workspace { grid-template-columns: 232px minmax(0,1fr); gap: 10px; padding: 10px; }
  .view-toolbar { max-width: calc(100% - 20px); flex-wrap: wrap; justify-content: center; }
  .view-presets { justify-content: center; }.toolbar-divider { display: none; }
}
@media (max-width: 760px) {
  :root { --mobile-dock-height: 56px; --mobile-controls-gap: 8px; }
  html, body { width: 100%; height: 100%; overflow: hidden; }
  .site-header { position: fixed; inset: 0 0 auto; }
  .site-header-inner { padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
  .brand { font-size: 16px; }.brand img { width: 34px; height: 34px; }
  .workspace { position: fixed; inset: var(--atlas-header-height) 0 0; width: 100%; height: calc(100dvh - var(--atlas-header-height)); min-height: 0; display: block; padding: 0; overflow: hidden; }
  .workspace:fullscreen { inset: 0; height: 100dvh; overflow: hidden; }
  .workspace > .inspector { display: none; }
  .stage, body[data-mode='anatomy'] .stage { position: absolute; inset: 0; height: 100%; min-height: 0; max-height: none; border: 0; border-radius: 0; }
  #app, body[data-mode='anatomy'] #app, body.detail[data-mode='anatomy'] #app, body.implant[data-mode='anatomy'] #app { inset: 8px 0 calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 24px); }
  .mobile-console { display: block; position: absolute; bottom: 0; left: max(8px,env(safe-area-inset-left)); right: max(8px,env(safe-area-inset-right)); padding-bottom: env(safe-area-inset-bottom); z-index: 5; pointer-events: none; }
  .mobile-control-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; height: var(--mobile-dock-height); padding: 5px 3px; border-top: 1px solid #d8e1d6; background: #fcfdf9f2; backdrop-filter: blur(12px); pointer-events: auto; }
  .mobile-control-tabs button { min-width: 0; min-height: 44px; background: transparent; border: 0; border-radius: 8px; font-size: 11px; font-weight: 550; }
  .mobile-control-tabs button[aria-expanded='true'] { background: #e4eee4; color: var(--accent); }
  .mobile-control-panel { display: flex; flex-direction: column; height: min(290px,calc(100dvh - var(--atlas-header-height) - var(--mobile-dock-height) - env(safe-area-inset-bottom) - 28px)); margin-bottom: 7px; padding: 0 12px; border: 1px solid #d4dfd3; border-radius: 12px; background: #fcfdf9fa; box-shadow: 0 8px 24px #203b3b14; backdrop-filter: blur(12px); overflow: hidden; pointer-events: auto; }
  .mobile-panel-head { height: 40px; display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; }
  .mobile-panel-head h2 { font-size: 12px; font-weight: 600; margin: 0; }.mobile-panel-head button { width: 38px; height: 38px; border: 0; background: transparent; font-size: 23px; }
  .mobile-page-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; }
  .mobile-control-page { display: flex; flex-direction: column; gap: var(--mobile-controls-gap); }
  .mobile-control-block { display: flow-root; flex-shrink: 0; min-width: 0; }
  .mobile-control-measure { position: absolute; left: 0; top: 0; width: 100%; visibility: hidden; pointer-events: none; }
  .mobile-control-measure .mobile-control-block { margin: 0 0 var(--mobile-controls-gap); }
  .mobile-pager { display: flex; align-items: center; justify-content: space-between; height: 38px; flex-shrink: 0; border-top: 1px solid var(--line); margin-top: 6px; }
  .mobile-pager button { border: 0; background: transparent; min-height: 34px; padding: 4px 0; font-size: 10px; color: var(--accent); }.mobile-pager output { font-size: 9px; color: var(--muted); }
  .mobile-control-panel .mode-switch, .mobile-control-panel .anatomy-presets, .mobile-control-panel .facial-context, .mobile-control-panel .layer-row, .mobile-control-panel .part-story, .mobile-control-panel .range-ends, .mobile-control-panel .educational-note, .mobile-control-panel .ip-part, .mobile-control-panel .ip-btns, .mobile-control-panel #removeCtl, .mobile-control-panel #revealRoots { margin: 0; }
  .mobile-control-panel .mode-switch button, .mobile-control-panel .anatomy-presets button { min-height: 40px; padding: 9px 4px; font-size: 11px; }
  .mobile-control-panel .control-label { font-size: 11px; margin-bottom: 0; }.mobile-control-panel .control-label output { font-size: 10px; }
  .mobile-control-panel input[type='range'] { height: 30px; }
  .mobile-control-panel .primary-button, .mobile-control-panel .quiet-button { min-height: 38px; padding: 10px; font-size: 11px; }
  .mobile-control-panel .facial-context { padding: 9px 10px; }.mobile-control-panel .facial-context button { min-height: 24px; font-size: 11px; }.mobile-control-panel .facial-context p { font-size: 9px; }
  .mobile-control-panel .layer-explanation, .mobile-control-panel .chart-hint { margin: 0; font-size: 10px; line-height: 1.6; }
  .mobile-control-panel #removeCtl { flex-direction: row; gap: 6px; }.mobile-control-panel #removeCtl button { flex: 1; font-size: 10px; }
  .mobile-arch-picker { display: flex; gap: 4px; margin-bottom: 7px; }.mobile-arch-picker button { flex: 1; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: transparent; font-size: 11px; }.mobile-arch-picker button[aria-pressed='true'] { color: var(--accent); background: #e4eee4; }
  #toothChart .tooth-row { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }.tooth-row button { min-height: 38px; padding: 8px 0; font-size: 11px; }
  #toothChart[data-mobile-arch='upper'] .tooth-row[data-arch='lower'], #toothChart[data-mobile-arch='lower'] .tooth-row[data-arch='upper'] { display: none; }
  .mobile-control-panel .part-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }.mobile-control-panel .part-card { flex-direction: column; justify-content: center; gap: 6px; padding: 8px 3px; }.mobile-control-panel .part-card strong { font-size: 10px; }.mobile-control-panel .part-card small, .mobile-control-panel .part-card > svg { display: none; }.mobile-control-panel .part-number { width: 23px; height: 23px; font-size: 9px; }
  .mobile-control-panel .part-story { padding: 2px 0; min-height: 0; }.mobile-control-panel .part-story p { margin: 5px 0 0; font-size: 11px; line-height: 1.65; }.mobile-control-panel .range-ends { padding-top: 2px; }
  .mobile-control-panel .ip-step, .mobile-control-panel .ip-sub { margin: 0; font-size: 11px; line-height: 1.6; }.mobile-control-panel .educational-note { padding: 0; font-size: 10px; line-height: 1.7; }
  .mobile-control-panel .view-toolbar { position: static; transform: none; display: flex; flex-wrap: wrap; justify-content: center; width: 100%; max-width: none; padding: 5px; box-shadow: none; }.mobile-control-panel .view-presets { width: 100%; justify-content: space-between; }.mobile-control-panel .view-presets button { flex: 1; min-height: 38px; font-size: 10px; padding: 9px 6px; }.mobile-control-panel .icon-button { width: 42px; height: 42px; padding: 11px; }
  .stage > .view-toolbar { display: none; }
  .anatomy-legend { bottom: calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 28px); font-size: 8px; gap: 3px 12px; }.stage-footer { bottom: calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 10px); left: 8px; right: 8px; font-size: 7px; justify-content: center; }.hint-separator { margin: 0 2px; }.mouse-symbol { display: none; }
  body.mobile-panel-open .anatomy-legend, body.mobile-panel-open .stage-footer { display: none; }
  #infoWrap { right: max(8px,env(safe-area-inset-right)); top: 8px; width: min(280px,calc(100% - 24px)); z-index: 4; }#infoWrap.collapsed { display: none; }
  #info { padding: 10px; }.tooth-summary { margin-bottom: 7px; }.selection-tools { margin-bottom: 7px; }.tooth-panel-tabs { margin-bottom: 7px; }
  #info .cond-btns { grid-template-columns: repeat(4,minmax(0,1fr)); }#info .cond-btns button { font-size: 9px; min-height: 34px; padding: 7px 2px; }#selectionActionHint { font-size: 8px; margin-top: 7px; }
  #info .br-top { margin: 0 0 6px; font-size: 10px; }#info .br-rows { gap: 4px; margin: 0 0 6px; }#info .br-row { font-size: 9px; }#info .br-row button { padding: 6px 10px; }#info #brClear { min-height: 30px; padding: 6px 10px; font-size: 10px; }
  #extractBar { bottom: calc(var(--mobile-dock-height) + env(safe-area-inset-bottom) + 12px); flex-wrap: wrap; white-space: normal; width: calc(100% - 20px); padding: 8px; justify-content: center; gap: 6px; z-index: 4; }
  #detailBar { top: 9px; left: 8px; right: auto; max-width: calc(100% - 16px); gap: 8px; }#detailLabel { font-size: 9px; }#backBtn { font-size: 10px; padding: 8px 10px; min-height: 34px; }
  #partLabels button { padding: 6px 8px; gap: 5px; font-size: 8px; }#partLabels button span { font-size: 9px; }#partLabels button::before { width: 14px; left: -15px; }
  .noscript { inset: var(--atlas-header-height) 0 0; }
}
@media (max-width: 760px) and (max-height: 520px) {
  :root { --atlas-header-height: calc(48px + env(safe-area-inset-top)); --mobile-dock-height: 44px; --mobile-controls-gap: 5px; }
  .brand { font-size: 14px; }.brand img { width: 30px; height: 30px; }.site-menu-toggle { height: 40px; width: 40px; padding: 8px; }
  .mobile-console { left: auto; width: min(340px,calc(100% - 16px)); }.mobile-control-tabs { height: 44px; padding: 3px; }.mobile-control-tabs button { min-height: 36px; font-size: 10px; }
  .mobile-control-panel { height: calc(100dvh - var(--atlas-header-height) - var(--mobile-dock-height) - env(safe-area-inset-bottom) - 12px); margin-bottom: 4px; padding: 0 9px; }.mobile-panel-head { height: 31px; }.mobile-panel-head button { height: 30px; }.mobile-pager { height: 29px; margin-top: 3px; }.mobile-pager button { min-height: 28px; }
  .mobile-control-panel .mode-switch button, .mobile-control-panel .anatomy-presets button, .mobile-control-panel .primary-button, .mobile-control-panel .quiet-button { min-height: 32px; padding: 7px; }.mobile-arch-picker button, .tooth-row button { min-height: 30px; padding: 6px; }.mobile-control-panel .view-presets button { min-height: 32px; }.mobile-control-panel .icon-button { width: 36px; height: 34px; padding: 8px; }
  #infoWrap { width: 260px; top: 5px; }#info { padding: 7px; }#info .panel-head { margin-bottom: 3px; }#info .collapse-btn { height: 25px; }.tooth-summary { margin-bottom: 5px; }.tooth-summary .fdi { font-size: 20px; }.tooth-summary .sub { display: none; }.tooth-summary #detailBtn { min-height: 28px; padding: 5px; }.selection-tools { margin-bottom: 5px; }.selection-tools button { min-height: 28px; padding: 5px 7px; }.tooth-panel-tabs { margin-bottom: 5px; padding-bottom: 4px; }.tooth-panel-tabs button { min-height: 26px; }#info .cond-btns button { min-height: 28px; padding: 5px 2px; }#info .section-label { margin-bottom: 5px; }#selectionActionHint { margin-top: 5px; line-height: 1.4; }
}
@media (max-width: 360px) { .brand { font-size: 14px; }.brand img { width: 30px; height: 30px; }.site-header-inner { gap: 4px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
