:root {
  color-scheme: light;
  --paper: #f7f8f3;
  --surface: #fffefa;
  --ink: #1d302c;
  --muted: #536661;
  --line: #d8ded5;
  --green: #155a4b;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button, select, .open-file { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, select:focus-visible, #file-input:focus-visible + .open-file {
  outline: 3px solid #398f77;
  outline-offset: 3px;
}
.masthead {
  height: 67px;
  padding-inline: clamp(20px, 4vw, 80px);
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fffefa;
  background: #183c34;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 26px; letter-spacing: -.06em; font-weight: 660; }
.monogram { width: 28px; height: 26px; position: relative; display: block; color: #b7d4a5; }
.monogram i { width: 5px; height: 22px; background: currentColor; border-radius: 4px; position: absolute; bottom: 2px; }
.monogram i:nth-child(1) { left: 3px; transform: rotate(16deg); }
.monogram i:nth-child(2) { left: 9px; height: 18px; bottom: 5px; transform: rotate(-29deg); }
.monogram i:nth-child(3) { left: 16px; height: 18px; bottom: 5px; transform: rotate(29deg); }
.monogram i:nth-child(4) { left: 22px; transform: rotate(-16deg); }
.mast-divider { height: 19px; width: 1px; background: #547368; }
.mast-area { color: #d2e0d3; font-size: 13px; letter-spacing: .025em; }
main { max-width: 1760px; padding: 32px clamp(20px, 4vw, 80px) 38px; margin: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 2px 0 25px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 670; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-size: clamp(30px, 3vw, 46px); font-weight: 580; line-height: 1.2; letter-spacing: -.06em; margin: 7px 0 0; }
.import { position: relative; display: grid; justify-items: end; gap: 7px; }
#file-input { width: 1px; height: 1px; position: absolute; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.open-file { min-height: 42px; padding: 0 17px; border-radius: 7px; color: white; background: var(--green); display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 590; }
.open-file:hover { background: #0e493c; }
.open-icon { font: 20px/1 Arial, sans-serif; border-bottom: 1.5px solid; padding-bottom: 0; }
#file-help { font-size: 11px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(235px, 282px) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.library, .viewer { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; overflow: hidden; }
.library { display: flex; flex-direction: column; padding: 23px 19px 19px; }
.library-title h2 { font-size: 20px; font-weight: 600; letter-spacing: -.045em; }
.library-title p { font-size: 12px; color: var(--muted); margin-top: 7px; }
.filters { display: grid; grid-template-columns: .85fr 1.15fr; gap: 8px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.filters label { display: grid; gap: 6px; align-items: start; color: var(--muted); font-size: 11px; font-weight: 590; }
.filters select { width: 100%; height: 36px; color: var(--ink); background: #fbfcf7; border: 1px solid #cdd5ca; border-radius: 5px; padding: 0 5px; font-size: 13px; }
#model-list { flex: 1; overflow-y: auto; align-content: start; padding: 19px 2px 3px; max-height: clamp(318px, 53vh, 580px); scrollbar-width: thin; scrollbar-color: #bdc9be transparent; }
.tooth-group + .tooth-group { margin-top: 20px; }
.tooth-group h3 { margin-bottom: 10px; color: var(--muted); font-size: 12px; letter-spacing: .012em; font-weight: 620; }
.tooth-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
#model-list button { border: 1px solid #d4dcd1; border-radius: 5px; color: #31443b; background: #fbfcf8; font-size: 13px; font-weight: 560; font-variant-numeric: tabular-nums; line-height: 1; min-height: 35px; min-width: 0; padding: 4px 2px; }
#model-list > button { margin: 2px; min-width: 30px; }
#model-list button:hover { background: #ebf2e6; border-color: #afc5af; }
#model-list button:is(.active, .selected, [aria-pressed="true"]) { background: var(--green); color: white; border-color: var(--green); }
.viewer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-head { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-heading { min-width: 0; }
.model-heading .eyebrow { font-size: 9px; }
#active-name { font-size: 21px; font-weight: 580; letter-spacing: -.045em; margin-top: 5px; overflow-wrap: anywhere; }
#model-meta { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
#model-meta:empty { display: none; }
.reset { white-space: nowrap; display: flex; align-items: center; gap: 7px; background: transparent; color: #375346; border: 1px solid #d1dbcf; border-radius: 5px; min-height: 33px; padding: 5px 9px; font-size: 12px; font-weight: 560; }
.reset span { line-height: .9; font-size: 18px; }
.reset:hover { background: #f0f5eb; }
.viewport { position: relative; height: clamp(320px, 54vh, 660px); min-width: 0; width: 100%; overflow: hidden; border-block: 1px solid var(--line); background: radial-gradient(ellipse at 54% 45%, #faf8f0 0, #e9eae1 74%, #e1e3d9 100%); }
#model-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#model-canvas:active { cursor: grabbing; }
#status:not(:empty), noscript { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); max-width: 90%; width: max-content; padding: 8px 12px; border: 1px solid #d0d7ce; border-radius: 6px; background: #fffef9f5; color: var(--ink); box-shadow: 0 2px 12px #223b2b12; font-size: 13px; line-height: 1.5; pointer-events: none; }
.viewer-foot { min-height: 45px; padding: 9px 19px; display: flex; gap: 18px; align-items: center; color: var(--muted); font-size: 12px; }
.viewer-foot span { display: flex; align-items: center; gap: 6px; }
.orbit-icon { width: 15px; height: 8px; border: 1.25px solid; border-radius: 50%; transform: rotate(-25deg); }
.zoom-icon { display: inline-block; width: 10px; height: 10px; position: relative; border: 1.25px solid; border-radius: 50%; margin-right: 4px; }
.zoom-icon::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.25px; background: currentColor; transform: rotate(45deg); }
@media (min-width: 1700px) { .masthead { padding-inline: max(80px, calc((100vw - 1600px) / 2)); } }
@media (max-width: 850px) {
  .workspace { grid-template-columns: 217px minmax(0, 1fr); gap: 10px; }
  .library { padding: 18px 13px; }
  .viewer-head { padding: 15px; }
  .viewer-foot { padding: 9px 13px; gap: 9px; font-size: 11px; flex-wrap: wrap; }
}
@media (max-width: 650px) {
  .masthead { height: 54px; }
  main { padding: 19px 13px 24px; }
  .page-head { margin: 0 3px 17px; gap: 10px; align-items: end; }
  h1 { font-size: clamp(23px, 6vw, 33px); margin-top: 5px; }
  .eyebrow { font-size: 9px; }
  .import { justify-items: end; }
  .open-file { font-size: 12px; gap: 7px; min-height: 37px; padding-inline: 10px; }
  #file-help { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 12px; }
  .viewer { order: -1; }
  .viewport { height: clamp(275px, 42svh, 435px); }
  .viewer-head { padding: 12px; }
  #active-name { font-size: 18px; }
  .reset { padding: 5px 7px; font-size: 11px; }
  .viewer-foot { min-height: 37px; gap: 6px 12px; font-size: 10px; }
  .library { padding: 16px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 14px 0; }
  #model-list { max-height: none; padding: 13px 2px 3px; }
  .tooth-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #model-list button { min-height: 40px; }
}
@media (prefers-reduced-motion: no-preference) { button, .open-file { transition: background-color .12s, border-color .12s; } }
