*{box-sizing:border-box} :root{color-scheme:dark;font-family:Inter,Segoe UI,Arial,sans-serif;color:#e5edf4;background:#0b141e}body{margin:0}button,input{font:inherit}button{cursor:pointer;border:1px solid #354656;border-radius:8px;background:#1b2d3d;color:#e6eef6;padding:10px 14px;min-height:42px}button:hover{background:#294557}button:focus-visible,input:focus-visible{outline:2px solid #5fe3c3;outline-offset:3px}button:disabled{opacity:.45;cursor:default}header{height:86px;padding:0 30px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #283847}.brand{display:flex;gap:13px;align-items:center}.mark{background:#6ae2c2;color:#0a2d28;width:40px;height:42px;border-radius:12px;display:grid;place-items:center;font-size:28px;font-weight:750}.brand strong{font-size:20px;letter-spacing:2px}.brand strong span{font-weight:400;color:#99adbe}.brand small{display:block;color:#8ca1b3;font-size:11px;margin-top:5px}.badge,.eyebrow{font-size:10px;letter-spacing:1.5px;color:#87c6ba}.badge{border:1px solid #355a55;border-radius:20px;padding:8px 12px}main{padding:24px;display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:20px;max-width:1800px;margin:auto}.viewer,aside{border:1px solid #2a3c4c;background:#101e2c;border-radius:16px;overflow:hidden}.toolbar{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;gap:15px;font-size:12px}.toolbar>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toolbar button,#choose{background:#70e2c3;color:#10372e;border:0;font-weight:650;flex-shrink:0}.dot{display:inline-block;width:7px;height:7px;background:#6c899e;border-radius:50%;margin-right:6px}nav{display:flex;padding:0 16px;gap:20px;border-bottom:1px solid #2a3c4c}nav button{background:transparent;border:0;border-radius:0;padding:14px 0;font-size:12px;color:#8fa4b7}nav button.active{color:#78e4c6;border-bottom:2px solid #78e4c6}nav button span{font-size:9px;display:inline-block;color:#ccac6c;margin-left:3px}.panel{display:none}.panel.active{display:block}#scene{position:relative;height:calc(100dvh - 290px);min-height:440px;background:radial-gradient(ellipse at 50% 40%,#223a4d,#0a1622)}#canvas{display:block;width:100%;height:100%;touch-action:none}#empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:35px;pointer-events:none}#empty button{pointer-events:auto}.orbit{font-size:64px;color:#6ee0c1;margin-bottom:20px}h1{font-size:25px;letter-spacing:-.5px;margin:0 0 10px}#empty p{font-size:13px;color:#9eb1c1;margin-bottom:25px}#empty small{font-size:11px;color:#8fa8b5;margin-top:18px}.viewTools{position:absolute;right:14px;top:14px;display:flex;gap:5px}.viewTools button{font-size:11px;padding:5px 10px;background:#112330dd}.gesture{position:absolute;bottom:18px;left:0;right:0;text-align:center;color:#718ca2;font-size:10px;pointer-events:none}.textpanel{min-height:440px;height:calc(100dvh - 290px);overflow:auto;padding:40px;line-height:1.7}.textpanel h2{font-size:23px}.textpanel p,.textpanel li{font-size:13px;color:#aabac7}.textpanel hr{border:0;border-top:1px solid #304352;margin:25px 0}footer{padding:12px 17px;display:flex;align-items:center;justify-content:space-between;color:#839aaf;font-size:10px;border-top:1px solid #2a3c4c}footer button{padding:4px 8px;font-size:11px;min-height:32px;background:transparent}aside{display:flex;flex-direction:column;max-height:calc(100dvh - 135px)}.asideTitle{padding:23px 20px 10px}aside h2{font-size:18px;font-weight:550;margin:7px 0 0}#layerCount{font-size:12px;background:#294151;padding:3px 7px;border-radius:7px;margin-left:8px}.layerActions{display:flex;gap:8px;padding:8px 20px}.layerActions button{font-size:11px;padding:7px 10px;min-height:34px}.search{padding:8px 20px 14px}.search input{width:100%;padding:11px;border:1px solid #304453;border-radius:8px;color:#cfdee9;background:#0c1823;font-size:12px}#layers{overflow:auto;flex:1;min-height:140px;padding:0 12px}.layer{padding:14px 9px;border-top:1px solid #263b4b}.layerHeader{display:flex;align-items:center;gap:10px}.layerHeader input[type=checkbox]{accent-color:#71e0c1;width:19px;height:19px;flex-shrink:0}.layerHeader label{font-size:12px;overflow-wrap:anywhere;flex:1;line-height:1.5;cursor:pointer}.swatch{width:19px;height:19px;border-radius:5px;border:1px solid #ffffff33}.opacity{display:flex;gap:12px;align-items:center;margin:13px 0 0 30px}.opacity input{width:100%;accent-color:#70dbbd}.opacity output{width:35px;text-align:right;font-size:11px;color:#92b5b4}.layer small{display:block;margin:8px 0 0 30px;font-size:10px;color:#6d879d}.placeholder{font-size:12px;color:#7893a7;padding:20px 9px;line-height:1.6}.notice{border-top:1px solid #2a4051;padding:16px 20px;font-size:11px;color:#b9a67d;line-height:1.6;background:#202a2d}.notice p{margin:5px 0 0;color:#9aabb7}#loading{position:absolute;inset:0;background:#0b1826ee;align-items:center;justify-content:center;flex-direction:column;gap:20px;font-size:14px}#loading:not([hidden]){display:flex}.spinner{width:32px;height:32px;border:2px solid #2a4a5a;border-top-color:#6cdec0;border-radius:50%;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:90%;background:#613f34;color:#fff3e6;padding:14px 20px;border-radius:10px;font-size:13px;z-index:10}.hidden{display:none!important}@media(max-width:850px){header{height:70px;padding:0 16px}.brand small{font-size:9px}.brand strong{font-size:16px}.badge{font-size:8px;padding:7px}main{padding:12px;grid-template-columns:1fr;gap:12px}#scene,.textpanel{height:53dvh;min-height:330px}aside{max-height:none}#layers{max-height:450px;min-height:100px}.asideTitle{padding:17px 20px 5px}.textpanel{padding:25px}nav{gap:15px}nav button{font-size:11px}nav button span{display:none}.viewTools{top:10px;right:10px}h1{font-size:21px}.gesture{font-size:9px}.notice{font-size:10px}}
#ct.ctpanel{height:calc(100dvh - 290px);min-height:440px;overflow:auto;background:#07111b;padding:15px}.ctControls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px;color:#9fb5c8;font-size:11px}.ctControls label{display:flex;align-items:center;gap:6px}.ctControls input[type=range]{width:90px;accent-color:#6ee0c1}.ctControls button{font-size:10px;min-height:30px;padding:5px 9px}.ctControls output{width:28px}.sliceGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.sliceGrid article{min-width:0;background:#000;border:1px solid #304454;border-radius:9px;overflow:hidden;padding:10px}.sliceTitle{font-size:11px;display:flex;justify-content:space-between;color:#8cb8c9;margin-bottom:8px}.sliceTitle output{color:#88d8bd;font-size:10px}.sliceGrid canvas{display:block;max-width:100%;width:100%;height:auto;touch-action:none;cursor:crosshair}.sliceGrid input{width:100%;accent-color:#6ee0c1;margin-top:12px}.ctReadout,#ctText,#ctEmpty{font-size:11px;color:#8da7bb;line-height:1.6;margin:12px 0}#ctEmpty{padding:80px 20px;text-align:center}#ctLayer{padding:10px 20px;border-bottom:1px solid #314556;font-size:12px}#ctLayer input[type=checkbox]{accent-color:#6ee0c1;width:18px;height:18px;vertical-align:middle;margin-right:8px}.layer small{line-height:1.6}.layer .kind{font-size:9px;color:#84c4b6;margin:5px 0 0 30px}.textpanel a{font-size:12px;color:#80d7bf}@media(max-width:850px){#ct.ctpanel{height:auto;max-height:none;min-height:330px}.sliceGrid{grid-template-columns:1fr}.ctControls{gap:10px}.sliceGrid canvas{max-height:70dvh;object-fit:contain}.sliceGrid article{padding:10px 15px}}
#viewLabel{position:absolute;top:24px;left:18px;color:#7ca3b7;font-size:10px;pointer-events:none}.layerGroup{padding:16px 10px 9px;color:#77d8bd;font-size:11px;font-weight:650;letter-spacing:.3px}.isolate{margin:10px 0 0 30px;min-height:30px;font-size:10px;padding:5px 9px}@media(max-width:850px){#viewLabel{top:55px;left:14px;font-size:9px}}
.accuracy{padding:12px;border:1px solid #827044;border-radius:8px;color:#e0c587!important;background:#302c22}.libraryFilters{display:flex;gap:10px;flex-wrap:wrap}.libraryFilters input,.libraryFilters select{padding:10px;border:1px solid #425565;border-radius:7px;color:#dae8f1;background:#0b1823;min-width:0}.libraryFilters input{flex:1}.libraryRow{padding:11px 0;border-bottom:1px solid #2e4252;font-size:12px}.libraryRow small{display:block;color:#8fa6b9;margin-top:5px}nav{overflow-x:auto;white-space:nowrap}nav button{flex-shrink:0}

#ctAxisNote{font-size:11px;color:#8da7bb;line-height:1.6}.ctControls select{max-width:240px;background:#122735;color:#d6eee7;border:1px solid #345261;padding:7px;border-radius:6px}.ctControls #ctFovOut{width:48px}.ctControls label[hidden]{display:none}

.sliceTabs{display:flex;gap:6px;position:sticky;top:-15px;background:#07111b;padding:9px 0;z-index:2;margin-bottom:6px}.sliceTabs button{flex:1;min-height:34px;padding:6px 8px;font-size:12px}.sliceTabs button.active{background:#6ee0c1;color:#10252b;border-color:#6ee0c1}.singleSlice .sliceGrid{display:block}.singleSlice .sliceGrid article[hidden]{display:none}.singleSlice .sliceGrid canvas{width:auto;max-width:100%;max-height:calc(100dvh - 510px);min-height:130px;margin:auto;object-fit:contain}.singleSlice .ctReadout{margin:6px 0}@media(max-width:850px){.singleSlice .sliceGrid canvas{max-height:36dvh}.sliceTabs{top:0}.ctControls{gap:7px}.ctControls select{max-width:180px}}

.singleSlice .sliceGrid canvas{width:min(100%,max(130px,calc(100dvh - 510px)));height:auto;min-height:0;max-height:none}@media(max-width:850px){.singleSlice .sliceGrid canvas{width:min(100%,36dvh);height:auto;max-height:none}}

.nerveMeasure{font-size:11px;color:#e7c38a;border:1px solid #71603f;border-radius:7px;padding:9px;margin:9px 0;line-height:1.6}.nerveMeasure summary{cursor:pointer}.nerveMeasure select{max-width:100%;background:#122735;color:#e4e9ed;margin:8px 0;padding:6px}.nerveMeasure p{margin:6px 0}

.ctRotationControl{flex:1 1 100%;padding:10px;border:1px solid #345261;border-radius:8px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.ctRotationControl[hidden]{display:none}.ctRotationControl label{flex:1 1 260px}.ctRotationControl input{flex:1;min-width:90px}.ctRotationControl output{min-width:35px}.rotationButtons{display:flex;gap:6px}.rotationButtons button{min-height:40px;min-width:48px}

.implantDetails{margin:10px 0;padding:12px;border:1px solid #345261;border-radius:8px}.implantDetails summary{cursor:pointer;color:#94e8cb}.implantCard{padding:8px 0 14px;border-bottom:1px solid #29404f}.implantCard h3{font-size:15px;color:#d7f2e9}.implantCard dl{display:grid;grid-template-columns:minmax(100px,1fr) minmax(90px,1.2fr);gap:8px 16px;font-size:13px;line-height:1.5}.implantCard dt{color:#8da7bb}.implantCard dd{margin:0;color:#d7eee8;overflow-wrap:anywhere}.implantSource{font-size:11px!important;color:#91a9ba;line-height:1.6}nav{overflow-x:auto}nav button{white-space:nowrap}

.viewer{grid-column:1;grid-row:1}main>aside{grid-column:2;grid-row:1 / span 2;align-self:start}.implantBelow{grid-column:1;grid-row:2;background:#10202d;border:1px solid #2a4051;border-radius:14px;padding:22px}.implantBelow[hidden]{display:none}.implantBelow h2{font-size:20px}.implantListNote{font-size:12px;color:#91a9ba;line-height:1.6}.implantDistance{font-size:13px;color:#9be4ca;line-height:1.6}.implantCard>button{font-size:12px;min-height:40px;margin-top:8px}.implantBelow .implantCard+ .implantCard{margin-top:18px}@media(max-width:850px){.viewer,.implantBelow,main>aside{grid-column:1;grid-row:auto}.implantBelow{padding:18px}}

/* Compact WebView-style layer disclosure; model viewport stays fixed. */
main{grid-template-columns:minmax(0,1fr)}
#layerDrawer{position:absolute;top:12px;left:12px;width:240px;max-width:calc(100% - 24px);z-index:4;background:#203935ed;border:1px solid #66847b;border-radius:9px;box-shadow:0 5px 20px #0005;backdrop-filter:blur(8px)}
#layerDrawer summary{cursor:pointer;min-height:38px;padding:10px 12px;font-size:12px;font-weight:650;color:#e3f6f0;list-style-position:inside}
#layerDrawer:not([open]){width:auto}
#layerDrawer aside{border:0;border-radius:0 0 9px 9px;background:transparent;max-height:min(380px,65dvh);overflow:auto}
#layerDrawer .asideTitle,#layerDrawer .notice{display:none}
#layerDrawer .layerActions{padding:4px 8px;gap:4px}
#layerDrawer .layerActions button{font-size:10px;padding:5px 8px;min-height:29px;flex:1}
#layerDrawer .search{padding:4px 8px 8px}
#layerDrawer .search input{padding:7px;font-size:11px}
#layerDrawer #layers{padding:0 8px;max-height:none;min-height:70px;overflow:visible;flex:none}
#layerDrawer .layer{padding:6px 2px}
#layerDrawer .layerHeader{gap:5px}
#layerDrawer .layerHeader label{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#layerDrawer .layerHeader input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:#78d9c8}
#layerDrawer .swatch{width:9px;height:9px;flex-shrink:0}
#layerDrawer .opacity{margin:3px 0 0 23px;gap:6px}
#layerDrawer input[type=range]{accent-color:#efa782;height:18px;margin:0;min-width:0}
#layerDrawer .opacity output{font-size:9px}
#layerDrawer .layer small,#layerDrawer .isolate{display:none}
#layerDrawer .layerGroup{padding:9px 2px 4px;font-size:10px}
#layerDrawer #ctLayer{padding:7px 8px;font-size:11px}
#viewLabel{top:auto;bottom:38px}
@media(max-width:850px){#layerDrawer{width:205px;top:10px;left:10px}#layerDrawer aside{max-height:235px}.viewTools{max-width:95px;flex-wrap:wrap;justify-content:flex-end}.viewTools button{font-size:10px;min-height:30px;padding:5px 7px}#layerDrawer summary{font-size:11px;min-height:34px;padding:8px 10px}}

#layerDrawer .layerGroupSection{border-top:1px solid #66847b66;padding:7px 2px}#layerDrawer .groupHeader{display:flex;align-items:center;gap:5px}#layerDrawer .groupHeader input{width:18px;height:18px;accent-color:#78d9c8;flex-shrink:0;margin:0}#layerDrawer .groupExpand{flex:1;min-width:0;border:0;background:none;font-size:11px;text-align:left;min-height:28px;padding:3px;color:#e3f6f0}#layerDrawer .groupExpand:before{content:'▸ ';color:#91bbae}#layerDrawer .groupExpand[aria-expanded=true]:before{content:'▾ '}#layerDrawer .groupOpacity{margin-top:2px}#layerDrawer .groupContent{padding-left:8px}#layerDrawer [hidden]{display:none!important}

.viewCompass{position:absolute;right:10px;bottom:30px;z-index:3;width:132px;padding:6px;background:#142732d9;border:1px solid #55736d;border-radius:10px;backdrop-filter:blur(6px)}.viewCompass>span{display:block;font-size:9px;text-align:center;color:#a7c4ba;margin:0 0 4px}.compassGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:3px}.viewCompass button{min-height:32px;padding:3px;font-size:10px;background:#29443f;border-color:#5a7970;border-radius:5px}.viewCompass button[aria-pressed=true]{background:#70d9bd;color:#10372e;border-color:#a6f0d9}.compassFooter{display:flex;gap:3px;margin-top:3px}.compassFooter button{flex:1;font-size:9px}.gesture{right:145px;left:10px;text-align:left}@media(max-width:600px){.viewCompass{width:117px;bottom:27px;right:7px}.viewCompass button{min-height:30px;font-size:9px}.gesture{display:none}}

/* Eye button keeps the view-direction palette out of the viewport until needed. */
.viewCompass{width:auto!important;padding:0;background:transparent;border:0;box-shadow:none;backdrop-filter:none;overflow:visible}
.viewCompass>summary{list-style:none;display:grid;place-items:center;width:44px;height:44px;border:1px solid #698d80;border-radius:50%;background:#203d36ed;color:#b9f1de;cursor:pointer;box-shadow:0 3px 12px #0005}
.viewCompass>summary::-webkit-details-marker{display:none}
.viewCompass>summary:focus-visible{outline:3px solid #7ee4c5;outline-offset:3px}
.viewCompass[open]>summary{background:#70d9bd;color:#10372e}
.compassTools{position:absolute;right:0;bottom:52px;width:142px;padding:7px;border:1px solid #55736d;border-radius:10px;background:#142732f5;box-shadow:0 5px 20px #0006;backdrop-filter:blur(8px)}
.compassTools>span{display:block;text-align:center;font-size:10px;color:#b7d6ca;margin-bottom:5px}
.viewCompass:not([open])>.compassTools{display:none}
.gesture{right:65px}

#meshDownloads{position:absolute;left:10px;bottom:9px;z-index:5;max-width:calc(100% - 74px);font-size:11px;color:#daf0e7}#meshDownloads>summary{cursor:pointer;list-style-position:inside;background:#203d36ed;border:1px solid #648a7e;border-radius:7px;padding:8px 10px;min-height:34px}.downloadPanel{position:absolute;bottom:42px;left:0;width:340px;max-width:calc(100vw - 55px);max-height:270px;overflow:auto;background:#142b28f5;border:1px solid #648a7e;border-radius:9px;padding:10px;box-shadow:0 5px 20px #0007}.downloadPanel p{font-size:10px;line-height:1.6;color:#a6c6ba;margin:0 0 8px}.meshDownloadRow{display:flex;align-items:center;gap:5px;padding:6px 0;border-top:1px solid #527165}.meshDownloadRow span{min-width:0;flex:1;overflow-wrap:anywhere;font-size:11px}.meshDownloadRow button{font-size:10px;padding:4px 7px;min-height:30px}.gesture{display:none}#viewLabel{bottom:51px}.brand strong{letter-spacing:.4px}.brand small{max-width:230px}@media(max-width:500px){.brand small{font-size:8px;max-width:210px}.badge{font-size:7px;padding:5px}.viewCompass{bottom:9px}.brand strong{font-size:17px}}

/* Downloads follow implant measurements in the page flow. */
#meshDownloads{position:relative;grid-column:1;grid-row:3;left:auto;bottom:auto;max-width:100%;width:100%;align-self:start}#meshDownloads>summary{padding:13px 16px;font-size:13px;min-height:44px}.downloadPanel{position:static;width:100%;max-width:none;max-height:420px;margin-top:5px;padding:14px;box-shadow:none}.implantCard .implantDistance,#nerveMeasureResults .implantDistance{color:#f8ffe7!important;background:#172e28;border:1px solid #8cae90;border-left:4px solid #d9efad;border-radius:7px;padding:11px 13px;font-size:14px;font-weight:700;line-height:1.7}.implantCard .implantDistance.distanceWarning,#nerveMeasureResults .implantDistance.distanceWarning{color:#ff969e!important;background:#351519;border-color:#e8737f;border-left-color:#ff586b}@media(max-width:850px){#meshDownloads{grid-row:auto}}
/* Viet Uc visual palette: gold #fab32f, orange #f15a22, neutral grey/white. */
:root{color-scheme:light;color:#30363d;background:#f4f4f2;--brand-gold:#fab32f;--brand-orange:#f15a22}body{background:#f4f4f2;color:#30363d}header{background:#fff;border-bottom:3px solid #fab32f}.brand strong{color:#454b52}.brand small{color:#68717a}.mark{background:#fab32f;color:#30363d}.badge{color:#76521b;border-color:#d6b778;background:#fff9e9}.viewer{background:#fff;border-color:#ccd0d4}.toolbar{background:#fff;color:#5a636d}.toolbar button,#choose{background:#fab32f;color:#302b20}.toolbar button:hover,#choose:hover{background:#ffc956}button{background:#fff;color:#3c444c;border-color:#c3c8ce}button:hover{background:#fff0d1}button:focus-visible,input:focus-visible,summary:focus-visible{outline-color:#f15a22}nav{background:#f8f8f6;border-color:#d7d9dc}nav button{color:#626b74}nav button.active{color:#9b510c;border-bottom-color:#f15a22}footer{color:#626b74;background:#f8f8f6;border-color:#d7d9dc}.dot{background:#e7a62b}.eyebrow{color:#99630e}#scene{background:radial-gradient(ellipse at 50% 40%,#343b43,#161c22)}#viewLabel{color:#d4d8dc}#empty h1{color:#f6f3ec}#empty p,#empty small{color:#c4c8ce}.orbit{color:#fab32f}#layerDrawer{background:#30363bf5;border-color:#a28a5b}#layerDrawer summary{color:#fff3d3}#layerDrawer .layerActions button{background:#454a50;color:#fff1cf;border-color:#8b7b5f}#layerDrawer .search input{background:#22282e;color:#f9f1e1;border-color:#8b7b5f}#layerDrawer .groupExpand,#layerDrawer .layerHeader label{color:#f6f0e5}#layerDrawer .groupExpand:before{color:#fab32f}#layerDrawer .groupHeader input,#layerDrawer .layerHeader input[type=checkbox],#layerDrawer input[type=range]{accent-color:#fab32f}#layerDrawer .opacity output{color:#fff1cc}#layerDrawer .layerGroupSection{border-color:#8b7b5f77}#layerDrawer .placeholder{color:#d4cec0}.viewCompass>summary{background:#30363bf2;border-color:#b6965a;color:#ffcf66}.viewCompass[open]>summary{background:#fab32f;color:#302b20}.compassTools{background:#30363bf5;border-color:#b6965a}.compassTools>span{color:#ffe2a1}.viewCompass button{background:#484b50;color:#fff3d5;border-color:#8c7a59}.viewCompass button[aria-pressed=true]{background:#fab32f;color:#302b20;border-color:#ffce6b}.implantBelow,.textpanel{background:#fff;border-color:#ccd0d4;color:#30363d}.implantBelow h2,.textpanel h2,.implantCard h3{color:#444b53}.implantListNote,.textpanel p,.textpanel li,.implantSource{color:#59646e}.implantCard{background:#f9f9f7;border-color:#d4d6d8}.implantCard dt{color:#68727b}.implantCard dd{color:#30363d}.implantCard .implantDistance,#nerveMeasureResults .implantDistance{background:#30363b;color:#fff4c6!important;border-color:#c9a964;border-left-color:#fab32f}.implantCard .implantDistance.distanceWarning,#nerveMeasureResults .implantDistance.distanceWarning{background:#351519;color:#ff969e!important;border-color:#e8737f;border-left-color:#ff586b}#meshDownloads>summary{background:#fff0cf;color:#5e451c;border-color:#d7b46b}.downloadPanel{background:#fffdf7;border-color:#d7b46b;color:#30363d}.downloadPanel p{color:#625b4e}.meshDownloadRow{border-color:#ded2b7}.meshDownloadRow button{background:#fab32f;color:#302b20;border-color:#d5a342}#toast{background:#5e431f;color:#fff7df}#ct .ctControls,#ct .ctReadout,#ct #ctText,#ctAxisNote,#ctImplantInfo,#nerveMeasureNote{color:#cad3da}#loading{background:#161c22ee;color:#fff5d8}.spinner{border-color:#685b41;border-top-color:#fab32f}

#boneDensity{grid-row:3}#meshDownloads{grid-row:4}#boneDensity p{font-size:12px;line-height:1.7;color:#59646e}#boneDensity select{max-width:100%;padding:8px;border:1px solid #bfc5cc;border-radius:6px}#measureBone{margin:8px;background:#fab32f;color:#302b20}#boneResults{overflow-x:auto}#boneResults table{border-collapse:collapse;width:100%;font-size:12px;min-width:360px}#boneResults th,#boneResults td{padding:9px 7px;border:1px solid #d4d6d8;text-align:left}#boneResults th{background:#fff0cf;color:#5e451c}#boneDensity .boneNote{background:#fff4d8;color:#614911;padding:10px;border-left:3px solid #fab32f}@media(max-width:850px){#boneDensity,#meshDownloads{grid-row:auto}}

.implantDetailsGrid{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:20px;align-items:start}.implantDetailsGrid dl{min-width:0}.implantRegionFigure{margin:0}.implantRegionCanvas{display:block;width:100%;height:auto;background:#20272e;border-radius:10px;touch-action:none;cursor:grab}.implantRegionCanvas:active{cursor:grabbing}.implantRegionFigure figcaption{font-size:10px;line-height:1.6;color:#5d6872;margin-top:7px}.boneLegend{font-weight:600}#showBoneCT{background:#fff0cf;color:#5e451c}@media(max-width:650px){.implantDetailsGrid{grid-template-columns:1fr}.implantRegionFigure{max-width:300px;margin:auto;width:100%}}

.heatControls{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}.heatControls select{width:100%;padding:6px;font-size:10px;background:#fff;border:1px solid #c3c8ce;border-radius:5px}.heatControls button{font-size:10px;min-height:30px;padding:5px 7px}.heatControls button:first-of-type{width:100%;background:#fff0cf;color:#5e451c}

.heatControls button[aria-pressed=true]{background:#fab32f;color:#302b20;border-color:#d5a342}.implantRegionCanvas{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}

.orientationSaveStatus{display:block;width:100%;font-size:10px;line-height:1.5;color:#59646e;padding:4px 1px}

#storagePanel{margin:12px 24px;background:#fff;border:1px solid #d7b46b;border-radius:10px;padding:12px;font-size:12px;color:#46515b}#storagePanel summary{cursor:pointer;font-weight:700}#storagePanel p{line-height:1.7}#storagePanel button{margin:3px;font-size:12px;min-height:36px}#storagePanel input{padding:9px;max-width:100%;border:1px solid #bfc5cc;border-radius:5px}.cloudRow{display:flex;align-items:center;gap:5px;padding:7px 0;border-top:1px solid #ddd}.cloudRow span{flex:1;min-width:0;overflow-wrap:anywhere}.showHeatmap{width:100%;background:#fab32f;color:#302b20;margin-top:7px;font-size:12px}#adminAccess{margin-top:12px;border-top:1px solid #ccc}@media(max-width:600px){#storagePanel{margin:8px 12px}}

#openDialog{max-width:560px;width:calc(100% - 32px);border:1px solid #b9a168;border-radius:16px;padding:24px;color:#303840;background:#fffdf7}#openDialog::backdrop{background:#10182099}

#boneDensity>summary{cursor:pointer;font-weight:700;padding:4px 0}#boneDensity .boneDensityContent{padding-top:18px}
/* Keep view tools inside the phone viewport; auxiliary actions use separate rows. */
.compassTools{width:200px;max-width:calc(100vw - 40px);max-height:calc(100dvh - 110px);overflow:auto;box-sizing:border-box}
.compassFooter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-top:6px}
.compassFooter button{min-width:0;min-height:34px;flex:none;font-size:11px;line-height:1.25;padding:6px 8px;white-space:normal;word-break:normal;overflow-wrap:normal}
#setFrontView,#resetViewBasis{grid-column:1/-1}
.compassGrid{grid-template-columns:repeat(3,minmax(0,1fr))}.compassGrid button{min-width:0;font-size:11px;min-height:34px}
.compassTools{width:182px}.compassGrid button,.compassFooter button{display:grid;place-items:center;padding:5px;min-height:44px}.viewCompass button svg{display:block;width:30px;height:30px;max-width:100%}.compassFooter{grid-template-columns:repeat(3,minmax(0,1fr))}#setFrontView,#resetViewBasis{grid-column:auto}.compassTools>span{font-size:11px}.viewCompass button:focus-visible{outline:2px solid #ffcf66;outline-offset:1px}

header{gap:12px;flex-wrap:wrap;height:auto;min-height:86px;padding-top:12px;padding-bottom:12px}.languageControl select{font:inherit;font-size:12px;padding:8px 10px;border:1px solid #d6b778;border-radius:8px;background:#fff9e9;color:#5e451c;min-height:40px}.languageControl{margin-left:auto;flex-shrink:0}@media(max-width:600px){header .badge{display:none}header{padding-left:16px;padding-right:16px}.brand{min-width:0;flex:1}.brand small{max-width:180px}.languageControl select{max-width:105px}}

/* Pviewer masthead: calm typography with a restrained clinic-gold accent. */
header{min-height:104px;padding:18px 30px;gap:20px;flex-wrap:nowrap;background:#fff;border-bottom:1px solid #e5e2da;box-shadow:0 2px 12px #30363d06;position:relative}
header:after{content:"";position:absolute;bottom:-1px;left:30px;width:48px;height:3px;border-radius:3px;background:#fab32f}
.brand{gap:14px;min-width:0;flex:1}.mark{width:48px;height:52px;flex-shrink:0;border-radius:14px;background:linear-gradient(145deg,#ffc956,#fab32f);color:#30363d;font-size:30px;box-shadow:0 3px 8px #b67e1420}
.brand strong{display:block;font-size:25px;font-weight:750;line-height:1.1;letter-spacing:-.8px;color:#30363d}.brand small{font-size:12px;line-height:1.45;margin-top:5px;max-width:none;color:#616a73}.brandCredit{display:block;margin-top:3px;font-size:10px;line-height:1.3;letter-spacing:.4px;color:#8a7350}
.languageControl{margin-left:auto;align-self:center}.languageControl select{border:1px solid #e1ded6;background:#faf9f6;color:#4e5660;border-radius:10px;padding:9px 12px;font-size:12px;min-height:40px;cursor:pointer}.languageControl select:focus-visible{outline:2px solid #fab32f;outline-offset:3px}
@media(max-width:600px){header{padding:15px 16px;min-height:98px;gap:10px}header:after{left:16px;width:36px}.brand{gap:10px}.mark{width:39px;height:45px;border-radius:11px;font-size:25px}.brand strong{font-size:23px}.brand small{font-size:10px;max-width:175px;line-height:1.4}.brandCredit{font-size:9px}.languageControl select{font-size:11px;padding:7px 8px;max-width:99px;min-height:38px}}
@media(max-width:360px){.brand small{max-width:140px;font-size:9px}.brand strong{font-size:21px}.mark{width:33px;height:40px}.brand{gap:8px}.languageControl select{max-width:88px;font-size:10px}}

/* Direction pad: one central cube surrounded by directional arrows. */
.compassTools{width:168px;padding:10px;border-radius:14px}.compassGrid{gap:1px;padding:3px}.compassGrid button{min-height:39px;border:0;background:transparent;border-radius:8px;padding:3px;color:#adb0b3;box-shadow:none}.compassGrid button:hover{background:#ffffff12;color:#fff}.compassGrid button[aria-pressed=true]{background:#ffffff0b;color:#ffcc68;border:0}.compassGrid button svg{width:34px;height:34px}.compassGrid button[data-angle=front] svg{width:38px;height:38px}.compassTools>span{font-size:11px;margin-bottom:5px}.compassFooter{border-top:1px solid #ffffff1f;padding-top:6px;gap:3px}.compassFooter button{min-height:32px;padding:3px;border:0;background:transparent;color:#d0c5ac}.compassFooter button svg{width:24px;height:24px}
/* Finger-sized targets retain the compact directional pad. */
.compassTools{width:184px;max-width:calc(100vw - 32px)}
.compassGrid{padding:1px;gap:2px}
.compassGrid button,.compassFooter button{min-width:44px;min-height:44px;touch-action:manipulation}
.compassFooter{gap:2px}
.viewCompass>summary{min-width:48px;min-height:48px;touch-action:manipulation}

.helpLink{color:#795016;text-decoration:none;font-size:11px;min-height:44px;display:inline-flex;align-items:center;padding:8px;border-radius:8px;flex-shrink:0}.helpLink:hover{background:#fff0cf}.helpLink:focus-visible{outline:2px solid #f15a22}footer{gap:5px;flex-wrap:wrap}footer>span{flex:1;min-width:80px}

.invImportOptions{padding:12px 0;margin:12px 0;border-top:1px solid #ddd4c2}.invImportOptions summary{cursor:pointer;min-height:44px}.invImportOptions input{font:inherit;width:100px;padding:8px;border:1px solid #b9b9b9;border-radius:6px;background:#fff;color:#30363d}.invImportOptions p{font-size:12px}

@media(max-width:600px){.toolbar{flex-wrap:wrap;justify-content:flex-end;gap:8px}.toolbar>div{flex-basis:100%;font-size:11px}.toolbar button{min-width:0;flex:1;white-space:normal;font-size:11px;line-height:1.35;padding:8px;min-height:44px}.toolbar #showPlan:disabled{display:none}}

/* Give the CT image space to resolve anatomy instead of shrinking it below the controls. */
.singleSlice .sliceGrid canvas{width:min(100%,640px,65dvh);max-height:none;height:auto}@media(max-width:850px){.singleSlice .sliceGrid canvas{width:100%;max-height:none;height:auto}}

#openDialog{max-height:88dvh;overflow:auto}#openDialog h2{font-size:22px;margin:0 0 18px}.openFormatList{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}.openFormatList li{padding:10px 12px;border:1px solid #e8dfcd;border-radius:10px;background:#fff9ed;display:flex;flex-direction:column;gap:3px}.openFormatList strong{font-size:14px;color:#624415}.openFormatList span{font-size:12px;color:#5c6268}.openHint{font-size:13px;line-height:1.55;color:#5c6268}.openActions{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.openActions button{min-height:46px;font-size:13px;white-space:nowrap}.openActions #pickFiles{background:#fab32f;border-color:#e2a32e;color:#303840;font-weight:650;flex:1}.openActions #pickFolder,.openActions #closePicker{background:#fff;color:#303840;border-color:#c4c9cc}.openHelp{border-top:1px solid #e4dfd5;font-size:13px;line-height:1.55}.openHelp summary{padding:13px 0;min-height:46px;cursor:pointer;font-weight:600;color:#4b535c}.openHelp ol{padding-left:22px;margin:0 0 12px}.openHelp li{padding:3px 0}.openHelp p{color:#606971;margin:0 0 14px}@media(max-width:480px){#openDialog{padding:20px}.openActions{display:grid;grid-template-columns:1fr 1fr}.openActions #pickFiles{grid-column:1/-1}.openFormatList li{padding:9px 10px}}

.compatiblePicker{font-size:12px;min-height:44px;background:#fff;color:#725017;border-color:#ceb989;margin-bottom:14px}

.headerUtilities{display:flex;flex-direction:column;align-items:flex-end;gap:3px;flex-shrink:0}.headerHelp{font-size:10px;font-weight:400;line-height:1.4;padding:4px 0;min-height:24px;border-radius:3px;color:#7b766e;white-space:nowrap}.headerHelp:hover{background:transparent;color:#795016;text-decoration:underline}@media(max-width:480px){.headerHelp{font-size:9px}.headerUtilities{gap:1px}}

.fileReadCard{border:1px solid #dcdfe2;border-radius:12px;padding:18px;margin:16px 0;background:#fff}.fileReadCard h3{font-size:15px;overflow-wrap:anywhere;margin:0 0 14px}.fileReadCard dl{display:grid;grid-template-columns:minmax(100px,1fr) 2fr;gap:8px 16px;font-size:13px;margin:0 0 12px}.fileReadCard dt{color:#69737b}.fileReadCard dd{margin:0;overflow-wrap:anywhere}.fileReadCard p,.fileReadCard li{font-size:12px}.fileReadCard ul{padding-left:18px}

/* Keep the implant survey shortcut usable on narrow screens. */
.sliceTabs{flex-wrap:wrap}.sliceTabs button{flex:1 1 85px;min-height:44px}.sliceTabs #ctImplantView{flex:1.5 1 130px}.sliceTabs button:disabled{opacity:.45;cursor:not-allowed}

/* Controls touch the slice view; details never separate them from the image. */
.ctSurveyHeader{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:8px 0 10px;color:#cad3da;font-size:12px}.ctSurveyHeader label{display:flex;align-items:center;gap:6px}.ctSurveyHeader select{max-width:240px;min-height:40px;background:#122735;color:#e5edf4;border:1px solid #345261;border-radius:6px;padding:6px}.ctSurveyHeader input{width:100px;accent-color:#fab32f}.ctImageControls{margin:0 0 8px;padding:10px;background:#101e2c;border:1px solid #345261;border-radius:0 0 9px 9px;gap:10px}.ctImageControls .ctRotationControl{margin:0;padding:0 0 8px;border:0;border-bottom:1px solid #345261;border-radius:0;gap:8px}.ctImageControls>label{flex:1 1 220px}.ctImageControls>label input{flex:1;min-width:80px}.ctImageControls output{min-width:42px;text-align:right}.ctExtraTools{color:#cad3da;font-size:12px;margin:10px 0}.ctExtraTools summary{cursor:pointer;min-height:40px;padding:10px 0}.ctExtraTools .ctControls{padding:8px}.ctReadout{overflow-wrap:anywhere}@media(max-width:650px){.ctSurveyHeader select{max-width:185px}.ctImageControls .ctRotationControl label{flex-basis:100%;font-size:11px}.ctImageControls>label{flex-basis:100%}.ctImageControls input[type=range]{min-height:32px}.ctImageControls .rotationButtons{margin-left:auto}.ctImageControls .rotationButtons button{min-height:44px}.ctImageControls{padding:9px}.sliceGrid{gap:8px}}
