:root {
  --paper: #f1f0e9;
  --ink: #222923;
  --muted: #626960;
  --line: #c9cdc3;
  --accent: #efbf36;
  --panel: #e5e7de;
  --focus: #186d80;
  --error: #852e10;
  --active-line: #a9841a;
  --active-fill: #eee6c9;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, output { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, input[type="range"], input[type="checkbox"] { cursor: pointer; }
button { color: inherit; }
button:disabled, input:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, #viewport:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button { transition: border-color .15s, background-color .15s, color .15s; }
[hidden] { display: none !important; }
.app { height: 100vh; height: 100dvh; min-height: 680px; display: grid; grid-template-rows: 76px minmax(0, 1fr); padding: 0 28px 20px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.wordmark { text-decoration: none; font-size: 19px; font-weight: 850; letter-spacing: -.04em; white-space: nowrap; }
.wordmark span { margin-left: 12px; font-size: 10px; font-weight: 500; letter-spacing: .11em; }
.edition { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .09em; }
.edition span { margin: 0 16px; color: var(--line); }
.workspace { display: grid; grid-template-columns: 308px minmax(0, 1fr); min-height: 0; }
.sidebar { min-width: 0; min-height: 0; overflow-y: auto; padding: 28px 24px 20px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sidebar-heading { margin-bottom: 23px; }
.eyebrow, .section-label { margin: 0; font-size: 9px; font-weight: 650; line-height: 1.5; letter-spacing: .12em; color: var(--muted); }
h1 { margin: 9px 0 0; font-size: 43px; line-height: 1; font-weight: 560; letter-spacing: -.055em; }
h1 > span { color: var(--active-line); }
.view-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 27px; gap: 22px; }
.view-tabs a { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 0 13px; font-size: 12px; line-height: 1.4; color: var(--muted); text-decoration: none; white-space: nowrap; }
.view-tabs a span { font-size: 14px; }
.view-tabs a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.view-tabs a[aria-current="page"]::after { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--ink); content: ""; }
.view-tabs a:hover { color: var(--ink); }
.control-section { margin-bottom: 26px; }
.section-label { margin-bottom: 11px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.action-button { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: transparent; text-align: left; font-size: 12px; font-weight: 550; }
.action-icon { width: 20px; text-align: center; font-size: 24px; font-family: Arial, sans-serif; font-weight: 400; line-height: 1; }
.action-button:hover:not(:disabled) { border-color: var(--ink); }
.action-button.is-active, .action-button[aria-pressed="true"] { background: var(--accent); border-color: var(--active-line); }
.activity-line { display: flex; align-items: center; gap: 8px; min-height: 34px; padding-top: 6px; font-size: 10px; color: var(--muted); }
.activity-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--active-line); flex-shrink: 0; }
.button-row { display: flex; gap: 7px; margin-top: 12px; }
.button-row.equal > * { flex: 1; }
.button { min-height: 42px; padding: 10px 9px; border: 1px solid var(--line); background: transparent; border-radius: 4px; font-size: 11px; font-weight: 550; line-height: 1.5; }
.button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.button:hover:not(:disabled) { border-color: var(--ink); }
.button.primary:hover:not(:disabled) { background: var(--muted); }
.button:not(.primary)[aria-pressed="true"] { background: var(--active-fill); border-color: var(--active-line); }
.full-width { width: 100%; }
.control-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 12px; font-weight: 600; }
output { font-variant-numeric: tabular-nums; font-size: 12px; }
input[type="range"] { display: block; width: 100%; height: 22px; margin: 10px 0 2px; accent-color: var(--active-line); }
.range-labels { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); }
.sidebar-bottom { padding-top: 2px; }
.hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.model-stats { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.viewport-panel { position: relative; min-width: 0; min-height: 0; margin: 16px 0 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
#viewport { position: absolute; inset: 0; cursor: grab; touch-action: none; }
#viewport:active { cursor: grabbing; }
#viewport:focus-visible { outline-offset: -5px; }
#viewport canvas { display: block; width: 100%; height: 100%; }
.viewport-topline { position: absolute; z-index: 2; top: 21px; left: 23px; right: 23px; display: flex; justify-content: space-between; align-items: center; gap: 18px; pointer-events: none; }
.scene-id { display: flex; align-items: center; gap: 8px; font-size: 9px; line-height: 1.5; letter-spacing: .09em; font-weight: 600; white-space: nowrap; }
.scene-id > i { width: 5px; height: 5px; border-radius: 50%; background: var(--active-line); }
.scene-id > span:last-child { color: var(--muted); font-weight: 500; }
.scene-divider { color: var(--muted); margin: 0 2px; }
#status { color: var(--muted); text-align: right; font-size: 10px; line-height: 1.5; }
.viewport-bottomline { position: absolute; z-index: 2; bottom: 19px; left: 23px; right: 23px; display: flex; justify-content: space-between; align-items: end; gap: 20px; pointer-events: none; }
.orbit-hint { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.orbit-hint > span { display: block; }
.camera-controls { display: flex; padding: 3px; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; pointer-events: auto; }
.camera-button { border: 0; background: transparent; min-height: 34px; padding: 8px 12px; font-size: 10px; border-radius: 2px; }
.camera-button:hover:not(:disabled), .camera-button[aria-pressed="true"], .camera-button.is-active { background: var(--panel); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }
.footer p { margin: 0; }
.footer > a { white-space: nowrap; }
.footer > a span { margin-left: 5px; }
.loading-state { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px; background: var(--panel); text-align: center; }
.loading-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.loading-mark { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--active-line); border-radius: 50%; animation: loading-turn 1.2s linear infinite; }
.error-state { position: absolute; z-index: 6; left: 10%; right: 10%; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); border-left: 3px solid var(--error); border-radius: 3px; background: var(--paper); padding: 22px; color: var(--error); font-size: 13px; line-height: 1.7; cursor: auto; }
.error-state p:first-child { margin-top: 0; }
.error-state p:last-child { margin-bottom: 0; }
.noscript { position: fixed; z-index: 20; left: 20px; right: 20px; bottom: 20px; padding: 20px; color: var(--error); background: var(--paper); border: 1px solid var(--error); font-size: 14px; }
.segmented { display: flex; gap: 3px; margin: 14px 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 4px; }
.segmented button { flex: 1; min-height: 33px; padding: 6px 4px; border: 0; border-radius: 2px; background: transparent; font-size: 10px; color: var(--muted); }
.segmented button.is-active, .segmented button[aria-pressed="true"] { color: var(--ink); background: var(--panel); font-weight: 600; }
.segmented button:hover:not(:disabled) { color: var(--ink); }
.checkbox-control { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 30px; font-size: 11px; cursor: pointer; }
.checkbox-control input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.parts-section { margin-bottom: 22px; }
.parts-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.parts-list:empty { display: none; }
.parts-list button, .part-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 34px; padding: 8px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); text-align: left; font-size: 11px; line-height: 1.35; }
.parts-list button:hover:not(:disabled), .part-button:hover:not(:disabled) { background: var(--panel); color: var(--ink); }
.parts-list button.is-active, .parts-list button.active, .parts-list button[aria-pressed="true"], .part-button.is-active { background: var(--active-fill); color: var(--ink); box-shadow: inset 3px 0 var(--active-line); }
.parts-list .part-number, .parts-list .part-index { flex-shrink: 0; width: 20px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.parts-list .part-name { flex: 1; }
.parts-list .part-count { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.selected-part { margin: 17px 0 0; }
.selected-part h3 { margin: 0 0 5px; font-size: 12px; line-height: 1.5; font-weight: 650; }
.selected-part p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.selection-actions { margin-top: 11px; }
.selection-actions .button { font-size: 10px; }
.labels { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.part-label, .model-label { position: absolute; display: inline-flex; align-items: center; gap: 6px; max-width: 180px; padding: 5px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font-size: 10px; font-weight: 550; line-height: 1.35; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 5px #2229230b; }
.part-label.is-active, .part-label.selected, .model-label.is-active { background: var(--active-fill); border-color: var(--active-line); }
.part-label { width: max-content; white-space: normal; max-width: 170px; }
.label-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.label-lines polyline { fill: none; stroke: #8b9283; stroke-width: 1; opacity: .7; }
.label-lines polyline.is-active { stroke: var(--active-line); stroke-width: 1.5; opacity: 1; }
@keyframes loading-turn { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .app { padding-left: 38px; padding-right: 38px; } .workspace { grid-template-columns: 330px minmax(0, 1fr); } .sidebar { padding-right: 32px; padding-top: 36px; } }
@media (max-width: 1000px) { .app { padding: 0 20px; } .workspace { grid-template-columns: 286px minmax(0, 1fr); } .sidebar { padding-right: 20px; } .viewport-topline { left: 16px; right: 16px; } .scene-id { font-size: 8px; gap: 6px; } .viewport-bottomline { left: 16px; right: 16px; gap: 10px; } .camera-button { padding: 8px; } }
@media (max-width: 760px) {
  .app { display: block; height: auto; min-height: 100vh; min-height: 100dvh; padding: 0 18px; }
  .masthead { min-height: 66px; }
  .edition { font-size: 8px; letter-spacing: .03em; }
  .edition span { margin: 0 5px; }
  .wordmark { font-size: 17px; }
  .wordmark span { margin-left: 6px; font-size: 8px; }
  .workspace { display: flex; flex-direction: column; }
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; row-gap: 0; overflow: visible; padding: 25px 0 12px; }
  .sidebar-heading { margin-bottom: 22px; }
  h1 { font-size: 39px; }
  .view-tabs { grid-column: 2; grid-row: 1; align-self: end; margin-bottom: 22px; gap: 18px; }
  .view-tabs a { gap: 5px; font-size: 11px; }
  .control-section { margin-bottom: 15px; }
  .sidebar-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: start; gap: 18px; padding-top: 0; }
  .model-stats { margin-top: 0; text-align: right; }
  .viewport-panel { flex: none; height: 65vh; height: 65svh; min-height: 400px; margin: 8px 0 18px; }
  .viewport-topline { top: 17px; }
  .viewport-bottomline { bottom: 15px; }
  .footer { padding: 14px 0 19px; font-size: 9px; }
  .parts-section { grid-column: 2; grid-row: 2 / 4; margin-bottom: 14px; }
  .parts-list { max-height: 172px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .selected-part { margin-top: 10px; }
  .selection-actions { flex-wrap: wrap; }
  .selection-actions .button { flex-basis: 100%; min-height: 35px; padding: 7px; }
  body[data-page="parts"] .sidebar-bottom { align-self: end; grid-column: 1; flex-direction: column; gap: 5px; }
  body[data-page="parts"] .model-stats { text-align: left; }
}
@media (max-width: 500px) {
  .edition { display: none; }
  .sidebar { display: block; }
  .sidebar-heading { margin-bottom: 19px; }
  .view-tabs { margin-bottom: 22px; gap: 30px; }
  .view-tabs a { font-size: 12px; }
  .action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .action-button { flex-direction: column; justify-content: center; gap: 6px; min-height: 72px; padding: 8px 3px; font-size: 10px; }
  .activity-line { min-height: 28px; }
  .button-row { margin-top: 7px; }
  .control-section { margin-bottom: 22px; }
  .sidebar-bottom { display: flex; flex-direction: row; justify-content: space-between; gap: 12px; }
  .hint, .model-stats { font-size: 9px; }
  .viewport-panel { min-height: 380px; }
  .viewport-topline { gap: 8px; }
  .scene-id { font-size: 8px; gap: 5px; letter-spacing: .03em; }
  #status { max-width: 100px; font-size: 9px; }
  .viewport-bottomline { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
  .orbit-hint { font-size: 9px; }
  .camera-button { padding: 6px 7px; min-height: 32px; font-size: 9px; }
  .camera-controls { margin-left: auto; }
  .footer { align-items: start; gap: 10px; }
  .footer p { max-width: 230px; }
  .parts-section { margin-bottom: 16px; }
  .parts-list { display: grid; grid-template-columns: 1fr 1fr; max-height: 142px; }
  .parts-list button { font-size: 10px; padding: 8px 6px; }
  .parts-list button:nth-child(odd) { border-right: 1px solid var(--line); }
  .selection-actions { flex-wrap: nowrap; }
  .selection-actions .button { flex-basis: 0; }
  body[data-page="parts"] .sidebar-bottom { flex-direction: row; }
  body[data-page="parts"] .model-stats { text-align: right; }
  .part-label, .model-label { font-size: 9px; max-width: 150px; padding: 4px 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; } .loading-mark { border-color: var(--line); border-top-color: var(--active-line); } }
