/* GPC model inspection. Shared studio tokens, renderer-specific controls. */
:root {
  --ui-bg: var(--bg);
  --ui-ink: var(--ink);
  --green: var(--cta);
  --green-soft: var(--accent-soft);
  --rail: 280px;
  --header: 64px;
  --footer: 40px;
  --radius: 8px;
  font-size: 14px;
  color: var(--ui-ink);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ui-bg); }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button.active { background: var(--cta); border-color: var(--cta); color: #fff; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink); }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-family: var(--font); font-size: 11px; letter-spacing: 0.08em; font-weight: 560; text-transform: uppercase; }
.panel-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.mobile-only { display: none; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 100; padding: 12px; background: var(--surface); border-radius: var(--radius-pill); }
.skip-link:focus { top: 8px; }
#app-header { position: fixed; inset: 0 0 auto; height: var(--header); z-index: 30; display: flex; align-items: center; gap: 20px; padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ui-bg) 86%, transparent); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 560; letter-spacing: -0.04em; text-decoration: none; }
.brand svg { width: 26px; height: 30px; stroke: var(--ink); stroke-width: 1.4; }
.brand-dot { color: var(--accent); }
.viewer-brand-name { font-size: 13px; font-weight: 450; letter-spacing: -.01em; color: var(--muted); }
.header-divider { height: 18px; width: 1px; background: var(--line); }
.workspace-label { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.workspace-tag { padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.header-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
#gui { position: fixed; top: var(--header); left: 0; bottom: var(--footer); width: var(--rail); z-index: 20; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; scrollbar-color: #d8d8d2 transparent; }
#gui button:not(.section-trigger) { min-height: 36px; border-radius: 6px; }
.section-trigger:hover { background: var(--soft); border-color: transparent; transform: none; }
#gui header { padding: 22px 20px 20px; border-bottom: 1px solid var(--line); }
#gui header .eyebrow { color: var(--faint); margin-bottom: 8px; }
#gui header h2 { font-size: 18px; font-weight: 560; letter-spacing: -.03em; margin-bottom: 4px; }
.gui-section { border-bottom: 1px solid var(--line); }
.gui-section > h2 { font-size: 13px; }
.section-trigger { display: flex; justify-content: space-between; width: 100%; padding: 14px 20px; min-height: 46px; border: 0; border-radius: 0; background: transparent; font-size: 13px; font-weight: 560; }
.section-trigger::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid #9a9a94; border-bottom: 1.5px solid #9a9a94; transform: rotate(-45deg); transition: transform 180ms var(--ease); margin-right: 3px; }
.open > h2 .section-trigger::after { transform: rotate(45deg) translate(-2px, -2px); }
.gui-section > .body { display: none; padding: 0 20px 18px; }
.gui-section.open > .body { display: block; }
.gui-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.gui-row > label { color: var(--muted); flex: 0 0 56px; font-size: 12px; }
.gui-row select, .gui-row input[type=range] { flex: 1; min-width: 0; }
.gui-row .readout { font: 11px var(--mono); color: var(--ink); border: 1px solid var(--line); background: var(--soft); border-radius: 8px; padding: 4px 7px; }
[data-section=MODEL] .gui-row:first-child { display: block; margin-top: 0; }
[data-section=MODEL] .gui-row:first-child > label { display: block; margin-bottom: 7px; }
[data-section=MODEL] .gui-row:first-child select { font-weight: 560; }
.info-line { margin: 12px 0; color: var(--muted); font-size: 12px; }
.info-line b { color: var(--ink-2); font-weight: 500; }
.gui-toggle { display: flex; cursor: pointer; font-size: 12px; padding: 5px 0; margin: 0; gap: 8px; min-height: 32px; }
.gui-toggle:hover { color: var(--ink); }
.gui-toggle span { overflow-wrap: anywhere; }
input[type=range] { appearance: none; width: 100%; height: 24px; background: transparent; cursor: ew-resize; margin: 0; min-height: 0; padding: 0; border: 0; box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, var(--ink) var(--range-progress, 0%), #e4e4de var(--range-progress, 0%)); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: #e4e4de; }
input[type=range]::-moz-range-progress { background: var(--ink); height: 3px; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border: 2px solid var(--surface); background: var(--ink); border-radius: 50%; }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid var(--surface); background: var(--ink); border-radius: 50%; }
.button-group { gap: 6px; margin: 0; display: flex; }
.button-group button { flex: 1; font-size: 12px; text-transform: capitalize; white-space: nowrap; min-height: 36px; padding-inline: 8px; border-radius: var(--radius-pill); }
[data-section=STYLE] .button-group { display: grid; grid-template-columns: repeat(3, 1fr); }
[data-section=STYLE] .button-group button { min-height: 58px; flex-direction: column; gap: 7px; font-size: 11px; padding: 9px 2px; background: var(--bg); border-radius: var(--radius); }
[data-section=STYLE] .button-group button::before { content: ''; display: block; height: 14px; width: 14px; border: 1px solid #b8b8b2; transform: rotate(30deg) skew(-5deg); border-radius: 2px; background: #e8e8e2; }
[data-section=STYLE] button[data-value=solid]::before { background: #c8c8c2; }
[data-section=STYLE] button[data-value=random]::before { background: conic-gradient(#c1a479 25%, #a6b49d 0 50%, #acbcc4 0 75%, #d3b4a4 0); }
[data-section=STYLE] button[data-value=mono]::before { background: #171717; }
[data-section=STYLE] button[data-value=wireframe]::before { background: transparent; border-color: #171717; }
[data-section=STYLE] button[data-value=blueprint]::before { background: #1d3b66; border-color: #879ebb; }
[data-section=STYLE] button[data-value=dither]::before { background: repeating-linear-gradient(45deg, #2f2f2f 0 1px, transparent 1px 3px); }
[data-section=STYLE] .button-group button.active { background: var(--soft); border-color: var(--ink); color: var(--ink); box-shadow: none; }
[data-section=STYLE] .style-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 10px; }
.gui-section.layers.open > .body { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 9px; }
.stepper { display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; width: 100%; gap: 3px; }
.stepper-label { grid-column: 1 / -1; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.stepper button { min-height: 28px; padding: 0; }
.stepper .value { text-align: center; font-size: 10px; text-transform: capitalize; }
[data-section=ANIMATION] .button-group { margin-top: 12px; }
[data-section=SECTION] .gui-row > .gui-toggle { flex: 0 0 54px; }
[data-section=SECTION] .button-group { margin-top: 13px; display: grid; grid-template-columns: repeat(4, 1fr); }
[data-section=SECTION] .button-group button { font-size: 10px; padding: 6px; }
#workspace { position: fixed; top: calc(var(--header) + 14px); left: calc(var(--rail) + 14px); bottom: calc(var(--footer) + 14px); right: 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); overflow: hidden; color: var(--ink); animation: rise 520ms var(--ease); }
#view { position: absolute; display: block; width: 100%; height: calc(100% - var(--canvas-top, 126px) - 52px); top: var(--canvas-top, 126px); touch-action: none; outline-offset: -3px; }
.stage-heading { position: absolute; top: 26px; left: 28px; right: 140px; z-index: 6; pointer-events: none; }
.stage-heading .eyebrow { color: color-mix(in srgb, var(--ink) 50%, var(--bg)); display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.08em; }
.eyebrow-rule { display: inline-block; width: 22px; height: 1px; background: currentColor; margin-inline: 3px; opacity: .35; }
.stage-heading h1 { font-family: var(--font); font-weight: 600; font-size: clamp(26px, 2.3vw, 34px); letter-spacing: -0.035em; line-height: 1.15; margin: 8px 0 6px; }
#model-subtitle { font-size: 13px; color: color-mix(in srgb, var(--ink) 48%, var(--bg)); }
.stage-bottom { position: absolute; z-index: 12; left: 24px; right: 24px; bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stage-caption { display: flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--ink) 52%, var(--bg)); font-size: 12px; }
.status-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; flex: 0 0 7px; box-shadow: 0 0 0 4px #10a37f22; }
#view-tools { display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-radius: var(--radius-pill); box-shadow: var(--shadow-sm); }
#view-tools button { border-color: transparent; min-height: 32px; font-size: 12px; padding: 6px 12px; background: transparent; }
#view-tools button:hover { background: var(--soft); }
#view-tools button.active { background: var(--cta); color: #fff; }
#view-tools .key-hint { display: none; }
.tool-divider { width: 1px; height: 16px; background: var(--line); margin-inline: 4px; }
#focus-toggle { font-size: 12px; color: color-mix(in srgb, var(--ink) 62%, var(--bg)); }
#focus-toggle:hover { color: var(--ui-ink); }
#loading { position: absolute; inset: 0; z-index: 15; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink); font-size: 14px; }
#banner { position: fixed; top: 80px; left: calc(var(--rail) + 32px); right: 32px; z-index: 40; border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 13px 17px; background: var(--warn-bg); color: var(--warn); font-size: 13px; box-shadow: var(--shadow-md); }
#viewcube { position: fixed; top: calc(var(--header) + 30px); right: 34px; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#viewcube canvas { display: block; touch-action: none; }
#viewcube .quad-btn { font-size: 11px; min-height: 28px; padding: 3px 8px; letter-spacing: .01em; width: 84px !important; background: var(--surface); }
#viewcube .quad-btn.active { background: var(--cta); color: #fff; }
#stats { position: fixed; right: 38px; bottom: calc(var(--footer) + 86px); width: 314px; z-index: 13; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow-sm); overflow: hidden; }
#stats-toggle { display: flex; width: 100%; justify-content: space-between; text-align: left; border: 0; background: transparent; padding: 14px 16px; border-radius: 0; min-height: 0; }
#stats-toggle .eyebrow { font-size: 11px; color: var(--faint); display: block; margin-bottom: 4px; }
.stats-summary { font-size: 12px; color: var(--muted); }
.stats-summary b { font: 14px var(--mono); color: var(--ink); font-weight: 500; }
.stats-separator { margin-inline: 9px; color: #c8c8c2; }
.disclosure-icon { font-size: 20px; font-weight: 300; color: var(--faint); }
#stats-detail { border-top: 1px solid var(--line); padding: 12px; max-height: 42vh; overflow: auto; }
#stats-detail .panel-note { font-size: 12px; margin: 0 2px 9px; }
table.stats { width: 100%; border-collapse: collapse; font: 11px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
table.stats td, table.stats th { text-align: right; padding: 4px 3px; white-space: nowrap; font-weight: normal; }
table.stats th { color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--line); }
table.stats td:first-child, table.stats th:first-child { text-align: left; font-family: var(--font); }
table.stats tr.total td { color: var(--ink); border-top: 1px solid var(--line); padding-top: 7px; font-weight: 600; }
#doc { position: fixed; top: calc(var(--header) + 187px); right: 38px; width: 340px; max-height: calc(100dvh - var(--header) - 390px); z-index: 14; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); color: var(--ui-ink); box-shadow: var(--shadow-sm); }
#doc.closed { width: 187px; }
#doc > h2 { flex: 0 0 auto; font-size: 11px; font-weight: 500; }
#doc > h2 button { width: 100%; justify-content: space-between; background: transparent; border: 0; border-radius: 0; padding: 12px 15px; font-size: 13px; text-transform: none; min-height: 0; }
#doc > h2 button::after { content: '−'; font-size: 18px; color: #839375; }
#doc.closed > h2 button::after { content: '+'; }
#doc:not(.closed) > h2 { border-bottom: 1px solid var(--line); }
#doc.closed > .md { display: none; }
#doc > .md { overflow-y: auto; scrollbar-width: thin; padding: 8px 20px 22px; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
#doc .doc-status { padding: 10px 15px; color: var(--muted); font-size: 11px; line-height: 1.5; border-top: 1px solid var(--line); }
#doc .doc-status.error { color: #955737; }
.md h1, .md h2, .md h3, .md h4 { font-weight: 600; line-height: 1.4; margin: 1.3em 0 .6em; }
.md h1 { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.md h2 { font-size: 15px; }
.md h3 { font-size: 13px; }
.md h4 { font-size: 12px; }
.md p { margin: .6em 0; }
.md ul, .md ol { margin: .6em 0; padding-left: 20px; }
.md li { margin: .25em 0; }
.md code { font: 10px/1.6 var(--mono); background: var(--soft); padding: 1px 4px; border-radius: 3px; }
.md pre { padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); overflow: auto; }
.md pre code { padding: 0; }
.md table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 10px; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 5px; text-align: left; vertical-align: top; }
.md a { color: var(--ink); text-decoration: underline; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md blockquote { border-left: 2px solid var(--ink); padding-left: 12px; margin: 12px 0; color: var(--muted); }
.md [data-section]:hover { text-decoration: underline; text-decoration-color: var(--ink); text-underline-offset: 4px; }
.md mark.ref { background: var(--accent-soft); color: inherit; border-bottom: 1px solid var(--accent); }
.md .flash, .md mark.ref.flash, .md mark.ref.pinned { background: #d8efe6; color: #0d3d30; }
#inspector { position: fixed; left: calc(var(--rail) + 38px); bottom: calc(var(--footer) + 90px); z-index: 14; width: 262px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); color: var(--ui-ink); }
#inspector .text { padding: 15px 17px; background: var(--surface); position: relative; }
#inspector h3 { font-size: 12px; font-weight: 600; padding-right: 23px; overflow-wrap: anywhere; }
#inspector .dims { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 10px 0 0; font: 11px/1.7 var(--mono); color: var(--muted); }
#inspector .dims b { font-weight: 500; color: var(--ink); }
#inspector .dims > div { display: flex; justify-content: space-between; gap: 10px; }
#inspector .dims dt { font: 11px var(--font); color: var(--muted); }
#inspector .dims dd { margin: 0; font-size: 10px; text-align: right; }
#inspector .viewport { display: block; width: 100%; aspect-ratio: 276 / 180; border-top: 1px solid var(--line); }
#inspector .inspector-close { position: absolute; top: 8px; right: 7px; min-width: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; font-size: 18px; }
.dim-label { position: fixed; z-index: 15; pointer-events: none; color: var(--ink); font: 10px var(--mono); transform: translate(-50%, -50%); background: var(--bg); border-radius: 3px; padding: 2px 4px; }
#hover-tag { position: fixed; z-index: 15; pointer-events: none; background: var(--surface); color: var(--ui-ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.5; max-width: min(320px, 80vw); overflow-wrap: anywhere; box-shadow: var(--shadow-md); }
#hover-tag b { color: var(--muted); font-weight: 400; }
#callout-lines { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9; }
#callout-lines line { stroke: var(--ink); stroke-opacity: .5; stroke-width: 1; }
#callout-lines circle { fill: var(--accent); }
.callout { position: fixed; z-index: 10; transform: translate(-50%, -50%); max-width: 180px; padding: 7px 10px; min-height: 30px; font-size: 11px; line-height: 1.45; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ui-ink); box-shadow: var(--shadow-sm); cursor: pointer; }
.callout:hover, .callout.active, .callout.pinned { background: var(--cta); border-color: var(--cta); color: white; }
#footer { position: fixed; bottom: 0; left: 0; right: 0; height: var(--footer); z-index: 21; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 22px; font-size: 12px; color: var(--faint); background: var(--ui-bg); }
#footer > span:first-child { letter-spacing: .2px; }
#footer > span:last-child { display: flex; gap: 20px; }
.footer-center { font-size: 9px; }
.footer-center i { margin-inline: 8px; color: #b1b9a8; font-style: normal; }
#quad-lines { position: absolute; left: 0; right: 0; top: var(--canvas-top, 126px); bottom: 52px; z-index: 5; display: none; pointer-events: none; }
#quad-lines.on { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#quad-lines span { padding: 16px; font: 9px var(--mono); letter-spacing: 1px; color: color-mix(in srgb, var(--ink) 40%, var(--bg)); border: .5px solid color-mix(in srgb, var(--ink) 10%, var(--bg)); }
body.focus-mode #gui, body.focus-mode #stats, body.focus-mode #doc, body.focus-mode .stage-heading, body.focus-mode #viewcube { visibility: hidden; }
body.focus-mode #workspace { left: 16px; }
body.focus-mode #inspector { left: 38px; }
@media (min-width: 1200px) {
  body.doc-open:not(.focus-mode) #view { width: calc(100% - 350px); }
  body.doc-open:not(.focus-mode) #quad-lines { right: 350px; }
}
#toast { position: fixed; z-index: 80; left: 50%; bottom: 52px; transform: translateX(-50%); padding: 12px 20px; border-radius: var(--radius-xl); border: 1px solid #2f2f2f; background: var(--sidebar); color: white; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in 280ms var(--ease); }
dialog { max-width: min(480px, calc(100vw - 32px)); padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ui-ink); box-shadow: var(--shadow-lg); animation: rise 320ms var(--ease); }
dialog::backdrop { background: #0d0d0d66; backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 12px; right: 12px; border: 0; font-size: 22px; background: transparent; }
dialog .eyebrow { color: var(--faint); margin-bottom: 14px; }
dialog h2 { font-family: var(--serif); font-size: 32px; font-weight: 400; line-height: 1.1; letter-spacing: -.03em; }
.help-intro { margin: 16px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.shortcut-list { margin: 0; font-size: 13px; }
.shortcut-list > div { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.shortcut-list dd { display: flex; gap: 5px; margin: 0; color: var(--muted); text-align: right; }
.shortcut-list kbd { opacity: 1; }
.help-footnote { margin-top: 24px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.noscript-message { position: fixed; inset: 40% 20% auto; padding: 25px; background: var(--surface); z-index: 100; text-align: center; }
@media (max-width: 1100px) {
  :root { --rail: 260px; }
  #gui header, .section-trigger { padding-left: 18px; padding-right: 18px; }
  .gui-section > .body { padding-left: 18px; padding-right: 18px; }
  .stage-caption { display: none; }
  .stage-bottom { justify-content: center; gap: 8px; left: 12px; right: 12px; }
  .workspace-tag { display: none; }
  .stage-heading h1 { font-size: 29px; }
  #stats { width: 286px; }
  #stats-detail { padding: 9px; }
  #doc { width: 310px; }
  .footer-center { display: none; }
}
@media (max-width: 760px) {
  :root { --header: 62px; --footer: 32px; --rail: 286px; }
  .mobile-only { display: inline-flex; }
  #app-header { gap: 10px; padding: 0 15px; }
  .brand { font-size: 23px; gap: 8px; }
  .brand svg { width: 25px; height: 29px; }
  .workspace-label, .header-divider, #help-toggle .key-hint, #share-button svg { display: none; }
  .header-actions { gap: 4px; }
  #help-toggle { font-size: 0; padding: 5px; min-width: 30px; }
  #help-toggle::after { content: '?'; font-size: 14px; }
  #share-button { padding: 7px 10px; font-size: 11px; }
  #controls-toggle { font-size: 11px; }
#gui { transform: translateX(-100%); transition: transform 180ms ease; z-index: 35; bottom: 0; box-shadow: 12px 0 40px #00000015; }
  .gui-toggle { min-height: 36px; }
  .stepper button { min-height: 36px; }
  body.controls-open #gui { transform: translateX(0); }
  #panel-backdrop { position: fixed; inset: var(--header) 0 0; background: #202a2040; border: 0; border-radius: 0; z-index: 34; backdrop-filter: blur(2px); }
  #workspace, body.focus-mode #workspace { top: calc(var(--header) + 9px); left: 9px; right: 9px; bottom: calc(var(--footer) + 9px); }
  .stage-heading { top: 20px; left: 18px; right: 95px; }
  .stage-heading .eyebrow { font-size: 8px; letter-spacing: .7px; flex-wrap: wrap; gap: 4px; }
  .stage-heading .eyebrow-rule { width: 8px; }
  .stage-heading h1 { font-size: 26px; margin-top: 8px; letter-spacing: -.7px; }
  #model-subtitle { font-size: 10px; line-height: 1.6; }
  #view { top: var(--canvas-top, 105px); height: calc(100% - var(--canvas-top, 105px) - 130px); }
  #viewcube { top: calc(var(--header) + 19px); right: 14px; }
  #viewcube canvas { width: 80px !important; height: 80px !important; }
  #viewcube .quad-btn { width: 65px !important; }
  .stage-bottom { bottom: 14px; left: 8px; right: 8px; gap: 5px; }
  #view-tools { gap: 0; padding: 3px; }
  #view-tools button { min-height: 33px; padding: 5px 10px; font-size: 10px; }
  #focus-toggle { font-size: 0; padding: 6px; min-height: 38px; border: 1px solid var(--line); background: var(--surface); }
  #focus-toggle::before { content: 'Focus'; font-size: 10px; }
  #focus-toggle[aria-pressed=true]::before { content: 'Exit'; }
  #focus-toggle[aria-pressed=true] { background: var(--green-soft); border-color: #819470; }
  #focus-toggle .key-hint { display: none; }
  #stats { bottom: calc(var(--footer) + 72px); left: 23px; right: 23px; width: auto; }
  #stats-toggle { padding: 10px 14px; }
  #stats-toggle .eyebrow { font-size: 8px; margin-bottom: 3px; }
  .stats-summary b { font-size: 13px; }
  #stats-detail { max-height: 34dvh; padding: 12px; }
  #doc { top: calc(var(--header) + 136px); right: 23px; left: 23px; width: auto; max-height: calc(100dvh - var(--header) - 283px); }
  #doc.closed { width: 155px; left: auto; }
  #doc > h2 button { padding: 8px 12px; min-height: 33px; font-size: 10px; }
  #doc > .md { padding: 6px 17px 20px; }
  #inspector, body.focus-mode #inspector { left: 23px; bottom: calc(var(--footer) + 150px); width: min(245px, calc(100vw - 46px)); }
  #inspector .viewport { aspect-ratio: 276 / 145; }
  #banner { top: 72px; left: 18px; right: 18px; }
  #footer { padding: 0 15px; font-size: 8px; gap: 5px; }
  #footer > span:last-child { gap: 10px; }
  #footer > span:first-child { display: none; }
  #footer > span:last-child { width: 100%; justify-content: space-between; }
  #quad-lines { top: var(--canvas-top, 105px); bottom: 130px; }
  #quad-lines span { padding: 8px; font-size: 8px; }
  body.focus-mode #view { top: 10px; height: calc(100% - 70px); }
  body.focus-mode #quad-lines { top: 10px; bottom: 60px; }
  dialog { padding: 28px 24px; }
  dialog h2 { font-size: 27px; }
  .shortcut-list { font-size: 10px; }
}
@media (max-width: 360px) {
  #share-button { width: 34px; min-width: 34px; padding: 7px; }
  #share-button svg { display: block; }
  #share-button span { display: none; }
}
@media (max-height: 500px) and (max-width: 760px) {
  .stage-heading { top: 12px; }
  .stage-heading .eyebrow, #model-subtitle { display: none; }
  .stage-heading h1 { font-size: 21px; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #view { top: 50px; height: calc(100% - 100px); }
  #quad-lines { top: 50px; bottom: 50px; }
  #viewcube { display: none; }
  #stats { left: auto; width: 205px; bottom: calc(var(--footer) + 69px); }
  #stats-toggle { padding: 7px 10px; }
  #stats-toggle .eyebrow { font-size: 7px; }
  .stats-summary { font-size: 9px; }
  .stats-summary b { font-size: 11px; }
  #doc { top: calc(var(--header) + 46px); max-height: calc(100dvh - var(--header) - 150px); }
  #inspector { bottom: calc(var(--footer) + 70px); width: 220px; }
  #inspector .viewport { aspect-ratio: 276 / 90; }
  dialog { max-height: calc(100dvh - 24px); overflow: auto; }
}
@media (max-height: 650px) and (min-width: 761px) {
  .stage-heading { top: 16px; }
  .stage-heading h1 { font-size: 27px; }
  #doc { top: 235px; max-height: calc(100dvh - 370px); }
  #inspector .viewport { aspect-ratio: 276 / 125; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Embedded model view: the estimating workspace supplies its own chrome and
   communicates selection through postMessage, so the viewer owns the full
   frame while retaining the canvas and element inspector. */
body.embedded #app-header,
body.embedded #gui,
body.embedded #stats,
body.embedded #footer,
body.embedded #viewcube,
body.embedded #doc,
body.embedded #panel-backdrop,
body.embedded #toast,
body.embedded .stage-heading,
body.embedded .stage-bottom,
body.embedded #quad-lines { display: none !important; }
body.embedded #workspace {
  top: 0; left: 0; right: 0; bottom: 0;
  border: 0; border-radius: 0;
}
body.embedded #view { top: 0; height: 100%; }
body.embedded #quad-lines { top: 0; bottom: 0; }
body.embedded #inspector { left: 16px; bottom: 16px; }

body.embedded.studio .stage-bottom {
  display: flex !important;
  left: 16px;
  right: 16px;
  bottom: 14px;
}
body.embedded.studio #focus-toggle,
body.embedded.studio .webmcp-line { display: none; }
body.embedded.studio #view {
  top: 0;
  height: calc(100% - 64px);
}
body.embedded.studio #inspector { left: 16px; bottom: 72px; }
body.embedded.studio #loading { inset: 0; }

/* Cut-face colour swatches: the square is the colour itself, so it carries its
   own outline (--swb, set in gui.js) - black would vanish on a black page and
   white on a white one. The active one gets a ring outside that. */
.swatch { flex: 0 0 auto; width: 1rem; height: 1rem; padding: 0; }
/* listed together to outrank button:hover / button.active, which would
   repaint the square with the accent colour */
.swatch, .swatch:hover, .swatch.active {
  background: var(--sw); border: 1px solid var(--swb);
}
.swatch:hover { outline: 1px solid var(--accent); outline-offset: 2px; }
.swatch.active { outline: 1px solid var(--ink); outline-offset: 2px; }
.swatch.active:hover { outline-color: var(--accent); }


.callout.pinned { z-index: 11; font-size: 1rem; padding: 0.35rem 0.7rem; max-width: 18rem; }
