/* The private studio is intentionally isolated from the public site's styles. */
:root {
  color-scheme: light;
  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
  --text-xs: clamp(.75rem, .72rem + .1vw, .8125rem);
  --text-sm: clamp(.875rem, .85rem + .08vw, .9375rem);
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 1.05rem + .5vw, 1.5rem);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --color-bg: #f5f1e9;
  --color-surface: #fcfaf5;
  --color-surface-2: #fffefa;
  --color-surface-offset: #eee9df;
  --color-canvas: #f2eee5;
  --color-border: #d8d1c4;
  --color-divider: #e4ddd2;
  --color-text: #302e28;
  --color-text-muted: #726b60;
  --color-text-inverse: #fcfaf5;
  --color-primary: #6f5139;
  --color-primary-hover: #553c28;
  --color-primary-highlight: #e9dfd1;
  --color-success: #486052;
  --color-error: #9b382b;
  --color-error-highlight: #f5e9e2;
  --radius-sm: 4px; --radius-md: 7px; --radius-lg: 12px;
  --shadow-panel: 0 8px 36px rgb(52 38 17 / .1);
  --transition: 150ms ease;
}
[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #25241f;
  --color-surface: #2c2a25;
  --color-surface-2: #34312b;
  --color-surface-offset: #39352d;
  --color-canvas: #26251f;
  --color-border: #514b40;
  --color-divider: #403c34;
  --color-text: #f2ebdf;
  --color-text-muted: #b6ac9d;
  --color-text-inverse: #26221c;
  --color-primary: #cbb18d;
  --color-primary-hover: #e3c9a4;
  --color-primary-highlight: #494033;
  --color-success: #b0c4b1;
  --color-error: #efad95;
  --color-error-highlight: #49342a;
  --shadow-panel: 0 8px 36px rgb(15 12 8 / .3);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); font-size: var(--text-sm); color: var(--color-text); background: var(--color-bg); line-height: 1.5; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, input[type="range"], input[type="checkbox"] { cursor: pointer; }
button { border: 0; background: none; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; transition: background-color var(--transition), color var(--transition), border-color var(--transition); }
button, a, summary { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
button[hidden], [hidden] { display: none !important; }
img, canvas { display: block; max-width: 100%; }
h1, h2 { font-family: var(--font-display); font-weight: 400; line-height: 1.25; text-wrap: balance; }
h3 { font-size: var(--text-sm); font-weight: 600; }
p { text-wrap: pretty; }
input:not([type="checkbox"]):not([type="range"]), select, textarea { min-height: 44px; width: 100%; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-error) !important; background: var(--color-error-highlight) !important; }
input::placeholder, textarea::placeholder { color: var(--color-text-muted); opacity: .9; }
textarea { resize: vertical; line-height: 1.6; min-height: 100px; }
input[type="number"] { font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select { padding-right: var(--space-8); }
label { display: block; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-width: 44px; min-height: 44px; padding: var(--space-2) var(--space-4); font-weight: 500; font-size: var(--text-sm); border: 1px solid transparent; border-radius: var(--radius-sm); white-space: nowrap; }
.primary { color: var(--color-text-inverse); background: var(--color-text); }
.primary:hover:not(:disabled) { background: var(--color-primary); }
.secondary { background: var(--color-surface); border-color: var(--color-border); }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: var(--color-surface-offset); }
.text-button { padding-inline: 0; color: var(--color-primary); }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.icon-button { padding: var(--space-2); width: 44px; flex: 0 0 44px; font-size: var(--text-lg); }
.full-width { width: 100%; }
.muted { color: var(--color-text-muted); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: var(--space-4); z-index: 100; padding: var(--space-3); color: var(--color-text-inverse); background: var(--color-text); }
.skip-link:focus { top: var(--space-2); }
.app-header { min-height: 76px; display: flex; align-items: center; gap: var(--space-6); padding: var(--space-3) var(--space-6); background: var(--color-surface); border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.brand-mark { display: block; width: 35px; height: 40px; background: var(--color-text); -webkit-mask: url('../assets/logo-mark.svg') center / contain no-repeat; mask: url('../assets/logo-mark.svg') center / contain no-repeat; }
.brand-type { display: flex; flex-direction: column; }
.brand-type > span:first-child { font-family: var(--font-display); font-size: var(--text-lg); letter-spacing: -.03em; line-height: 1.25; }
.brand-type > span:last-child { font-size: var(--text-xs); letter-spacing: .15em; text-transform: uppercase; }
.workspace-label { color: var(--color-text); display: flex; align-items: center; gap: var(--space-6); font-weight: 500; }
.workspace-label small { display: block; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 400; }
.header-rule { height: 32px; width: 1px; background: var(--color-border); }
.header-actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.help-glyph { border: 1.5px solid currentColor; width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); }
.theme-disc { width: 19px; height: 19px; border: 1.5px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); transform: rotate(-30deg); }
.app-main { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.project-bar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); min-height: 85px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); flex-shrink: 0; }
.project-heading { min-width: 0; flex: 1; }
.project-heading h1 { font-size: var(--text-xl); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 52vw; }
.save-state { margin-top: var(--space-1); display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.state-dot, .status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary); flex: 0 0 6px; }
.save-state[data-state="saved"] .state-dot, .status-dot[data-state="connected"] { background: var(--color-success); }
.save-state[data-state="error"] .state-dot, .status-dot[data-state="offline"] { background: var(--color-error); }
.revision-label { padding-left: var(--space-2); border-left: 1px solid var(--color-border); }
.project-actions, .history-actions { display: flex; align-items: center; gap: var(--space-2); }
.history-actions { margin-right: var(--space-2); gap: 0; }
.history-actions .button { padding-inline: var(--space-3); }
.history-actions .button > span:first-child { font-size: var(--text-lg); }
.workbench { display: grid; grid-template-columns: minmax(0,1fr) 320px; flex: 1; min-height: 0; }
.canvas-panel { min-width: 0; min-height: 0; background: var(--color-canvas); position: relative; display: flex; flex-direction: column; }
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6) 0; flex-shrink: 0; z-index: 2; }
.segmented { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-offset); }
.segmented button { flex: 1; min-width: 44px; min-height: 44px; border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); white-space: nowrap; font-weight: 500; font-size: var(--text-sm); color: var(--color-text-muted); }
.segmented button:hover:not(:disabled) { color: var(--color-text); background: var(--color-surface); }
.segmented button[aria-pressed="true"] { color: var(--color-text); background: var(--color-surface-2); box-shadow: 0 1px 3px rgb(50 35 15 / .1); }
.canvas-actions { display: flex; gap: var(--space-1); }
.canvas-actions .button { padding-inline: var(--space-2); font-size: var(--text-xs); }
.canvas-actions [aria-pressed="true"] { background: var(--color-surface-2); border-color: var(--color-border); }
.stage { position: relative; flex: 1; min-height: 180px; overflow: hidden; }
.model-container { position: absolute; inset: 0; }
.model-container canvas { width: 100%; height: 100%; outline: none; touch-action: none; }
.model-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--space-4); color: var(--color-text-muted); font-size: var(--text-xs); pointer-events: none; }
.loading-line { width: 100px; height: 2px; background: var(--color-border); overflow: hidden; }
.loading-line::after { content: ''; display: block; width: 40%; height: 100%; background: var(--color-primary); animation: loading 1.2s ease-in-out infinite alternate; }
@keyframes loading { to { transform: translateX(150%); } }
.canvas-caption { position: absolute; top: var(--space-5); left: var(--space-6); right: var(--space-6); display: flex; justify-content: space-between; color: var(--color-text-muted); font-size: var(--text-xs); pointer-events: none; gap: var(--space-3); }
.canvas-caption > span:first-child { font-size: var(--text-xs); letter-spacing: .12em; }
.canvas-caption > span:last-child { font-variant-numeric: tabular-nums; }
.gesture-hint { position: absolute; left: var(--space-6); right: var(--space-6); bottom: var(--space-3); text-align: center; pointer-events: none; color: var(--color-text-muted); font-size: var(--text-xs); }
.sequence-panel { flex-shrink: 0; padding: var(--space-3) var(--space-6) var(--space-5); }
.sequence-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.sequence-heading output { color: var(--color-primary); }
.sequence-controls { display: flex; align-items: center; gap: var(--space-5); }
.sequence-presets { min-width: 330px; }
.sequence-slider { flex: 1; min-width: 70px; }
input[type="range"] { width: 100%; min-height: 44px; background: transparent; accent-color: var(--color-primary); }
input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; }
.inspector { min-height: 0; background: var(--color-surface); border-left: 1px solid var(--color-border); display: flex; flex-direction: column; }
.inspector-tabs { display: flex; min-height: 58px; flex-shrink: 0; padding-inline: var(--space-3); border-bottom: 1px solid var(--color-border); }
.inspector-tabs button { flex: 1; min-width: 44px; min-height: 48px; font-size: var(--text-xs); font-weight: 500; color: var(--color-text-muted); position: relative; }
.inspector-tabs button[aria-selected="true"] { color: var(--color-text); }
.inspector-tabs button[aria-selected="true"]::after { content: ''; height: 2px; background: var(--color-primary); position: absolute; bottom: -1px; left: var(--space-3); right: var(--space-3); }
.inspector-tabs button:hover { color: var(--color-text); background: var(--color-surface-offset); }
.inspector-scroll { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
.tab-panel { padding: var(--space-6) var(--space-5); }
.eyebrow { color: var(--color-primary); text-transform: uppercase; letter-spacing: .14em; font-size: var(--text-xs); font-weight: 500; }
.panel-intro { margin-bottom: var(--space-6); }
.panel-intro h2 { font-size: var(--text-lg); margin-top: var(--space-2); }
.panel-intro > p:last-child { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-2); }
.control-section { border: 0; padding: 0; margin-bottom: var(--space-6); min-width: 0; }
.control-section + .control-section { padding-top: var(--space-1); }
legend { font-size: var(--text-sm); font-weight: 500; width: 100%; margin-bottom: var(--space-3); }
legend > span { float: right; font-size: var(--text-xs); font-weight: 400; color: var(--color-text-muted); padding-top: 2px; }
.dimension-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-2); }
.dimension-fields > label { font-size: var(--text-xs); color: var(--color-text-muted); }
.number-unit { display: block; position: relative; margin-top: var(--space-2); }
.number-unit > input { padding-left: var(--space-2) !important; padding-right: var(--space-6) !important; color: var(--color-text); font-size: var(--text-base); }
.number-unit > span { position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--color-text-muted); font-size: var(--text-xs); }
.number-unit.compact { width: 92px; margin-top: 0; flex-shrink: 0; }
.field-help { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.6; margin-top: var(--space-2); }
.input-row, .select-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); min-height: 44px; }
.select-row select { width: 140px; flex-shrink: 0; }
#setting-legStyle { width: 180px; }
.quiet-note { padding-top: var(--space-4); border-top: 1px solid var(--color-divider); color: var(--color-text-muted); font-size: var(--text-xs); line-height: 1.7; }
.quiet-note strong { font-weight: 500; color: var(--color-text); }
.quiet-note strong + p { margin-top: var(--space-1); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); position: relative; min-height: 64px; cursor: pointer; padding-block: var(--space-2); }
.toggle-row strong { display: block; font-size: var(--text-sm); font-weight: 500; }
.toggle-row small { display: block; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }
.toggle-row input { position: absolute; right: 0; width: 44px; height: 44px; opacity: 0; z-index: 1; }
.switch { width: 40px; height: 24px; border-radius: 20px; border: 1px solid var(--color-border); background: var(--color-surface-offset); flex: 0 0 40px; padding: 3px; transition: background-color var(--transition); }
.switch::after { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--color-text-muted); transition: transform var(--transition); }
.toggle-row input:checked + .switch { background: var(--color-text); border-color: var(--color-text); }
.toggle-row input:checked + .switch::after { background: var(--color-surface); transform: translateX(16px); }
.toggle-row input:focus-visible + .switch { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.material-swatches { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-3); }
.material-swatch { text-align: left; padding: var(--space-1); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface-2); min-height: 44px; }
.material-swatch[aria-pressed="true"] { border: 2px solid var(--color-primary); padding: 3px; }
.material-swatch:hover { border-color: var(--color-primary); }
.material-swatch img { width: 100%; height: 54px; object-fit: cover; background: var(--color-surface-offset); border-radius: 2px; }
.material-swatch > span { display: flex; justify-content: space-between; gap: var(--space-1); padding: var(--space-2) var(--space-1) var(--space-1); font-size: var(--text-xs); }
.material-swatch[aria-pressed="true"] > span::after { content: '✓'; }
#material-selection { margin-bottom: var(--space-6); }
.project-fields > label { margin-bottom: var(--space-4); font-weight: 500; }
.project-fields input, .project-fields textarea, .project-fields select { margin-top: var(--space-2); font-weight: 400; }
.project-fields label > .muted { float: right; font-size: var(--text-xs); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.section-title-row h3 { line-height: 1.4; }
.section-title-row h3 > span { display: block; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 400; }
.section-title-row .button { padding-inline: var(--space-3); font-size: var(--text-xs); }
.reference-list { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); }
.empty-references { padding: var(--space-4); background: var(--color-surface-offset); border-radius: var(--radius-sm); font-size: var(--text-xs); color: var(--color-text-muted); }
.empty-line { display: block; width: 26px; height: 2px; background: var(--color-border); margin-bottom: var(--space-3); }
.reference-card { border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.reference-card summary { list-style: none; display: flex; align-items: center; gap: var(--space-3); min-height: 66px; padding: var(--space-2); }
.reference-card summary::-webkit-details-marker { display: none; }
.reference-card summary::after { content: '＋'; margin-left: auto; font-size: var(--text-base); color: var(--color-text-muted); }
.reference-card[open] summary::after { content: '−'; }
.reference-card summary img { width: 48px; height: 48px; object-fit: cover; background: var(--color-surface-offset); flex-shrink: 0; border-radius: 2px; }
.reference-card summary > span { min-width: 0; font-size: var(--text-xs); }
.reference-card summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; max-width: 155px; }
.reference-card summary small { font-size: var(--text-xs); color: var(--color-text-muted); }
.reference-content { padding: var(--space-3); border-top: 1px solid var(--color-divider); }
.reference-content > img { max-height: 180px; width: 100%; object-fit: contain; margin-bottom: var(--space-3); background: var(--color-surface-offset); }
.reference-content label { font-size: var(--text-xs); margin-bottom: var(--space-3); }
.reference-content select, .reference-content textarea { margin-top: var(--space-1); }
.reference-content textarea { min-height: 76px; }
.reference-content .remove-reference { color: var(--color-error); font-size: var(--text-xs); }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-3); }
.export-grid .button { padding-inline: var(--space-2); font-size: var(--text-xs); }
#button-save-copy { margin-top: var(--space-3); font-size: var(--text-xs); }
.components-details { border-top: 1px solid var(--color-divider); }
.components-details > summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; font-weight: 500; }
.components-details > summary::after { content: '＋'; }
.components-details[open] > summary::after { content: '−'; }
.part-row { padding-block: var(--space-3); border-bottom: 1px solid var(--color-divider); font-size: var(--text-xs); display: flex; flex-direction: column; gap: var(--space-1); }
.part-row strong { font-weight: 500; }
.part-row span { color: var(--color-text-muted); }
.inspector-footer { min-height: 40px; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-5); border-top: 1px solid var(--color-border); font-size: var(--text-xs); color: var(--color-text-muted); flex-shrink: 0; }
.inspector-footer .button { margin-left: auto; padding-block: 0; font-size: var(--text-xs); }
.app-footer { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: 0 var(--space-6); min-height: 44px; background: var(--color-surface); border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: var(--text-xs); flex-shrink: 0; }
.app-footer button { text-decoration: underline; text-underline-offset: 3px; min-height: 44px; color: var(--color-text); }
.app-footer p:last-child { text-align: right; max-width: 330px; }
.action-notice { position: absolute; bottom: var(--space-4); left: var(--space-4); right: 336px; z-index: 8; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-2); box-shadow: var(--shadow-panel); font-size: var(--text-sm); }
.action-notice > span { flex: 1; }
.action-notice[data-kind="error"] { color: var(--color-error); border-color: var(--color-error); }
.inline-error { color: var(--color-error); font-size: var(--text-xs); background: var(--color-error-highlight); padding: var(--space-3); border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.model-fallback { position: absolute; inset: var(--space-10) var(--space-6) var(--space-8); display: flex; gap: var(--space-5); align-items: center; justify-content: center; }
.model-fallback > img { width: 45%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.model-fallback figcaption { max-width: 250px; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-xs); }
.model-fallback figcaption strong { font-size: var(--text-base); font-weight: 500; }
.model-fallback figcaption .button { align-self: flex-start; margin-top: var(--space-2); }
.exit-presentation { position: absolute; top: var(--space-4); right: var(--space-6); z-index: 5; box-shadow: var(--shadow-panel); }
body.is-presenting .app-header, body.is-presenting .inspector, body.is-presenting .project-actions, body.is-presenting .canvas-toolbar, body.is-presenting .app-footer p:first-child { display: none; }
body.is-presenting .project-bar { min-height: 76px; padding-right: 190px; }
body.is-presenting .workbench { grid-template-columns: minmax(0,1fr); }
body.is-presenting .stage { min-height: 0; }
body.is-presenting .app-footer { justify-content: flex-end; }
body.is-presenting .canvas-caption { top: var(--space-6); }
body.is-presenting .sequence-panel { width: min(760px,100%); align-self: center; }
body.is-presenting .action-notice { right: var(--space-4); }
dialog { color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); width: min(600px, calc(100vw - 32px)); max-height: min(90dvh, 820px); padding: var(--space-6); margin: auto; overflow: auto; box-shadow: var(--shadow-panel); }
dialog::backdrop { background: rgb(36 31 23 / .4); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-3); }
.dialog-header h2 { font-size: var(--text-xl); margin-top: var(--space-2); }
.dialog-description { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-6); }
.dialog-actions:empty { margin-top: 0; }
#dialog-error { margin-top: var(--space-4); }
.dialog-copy p { margin-bottom: var(--space-4); line-height: 1.7; }
.dialog-copy h3 { margin-top: var(--space-5); margin-bottom: var(--space-2); }
.dialog-copy dl { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.dialog-copy dd { color: var(--color-text-muted); }
.preset-list, .project-list, .version-list { display: flex; flex-direction: column; gap: var(--space-3); }
.preset-card, .project-item, .version-item { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); min-height: 76px; text-align: left; width: 100%; }
.preset-card:hover, .project-item:hover, .version-item:hover { background: var(--color-surface-offset); border-color: var(--color-primary); }
.preset-card strong, .project-item strong, .version-item strong { display: block; font-size: var(--text-base); font-weight: 500; overflow-wrap: anywhere; }
.preset-card small, .project-item small, .version-item small { display: block; margin-top: var(--space-1); color: var(--color-text-muted); font-size: var(--text-xs); }
.list-arrow { color: var(--color-primary); flex-shrink: 0; }
.dialog-empty { background: var(--color-surface-offset); padding: var(--space-6); border-radius: var(--radius-md); }
.dialog-empty h3 { margin-bottom: var(--space-2); font-size: var(--text-base); }
.dialog-empty p { font-size: var(--text-sm); color: var(--color-text-muted); }
.project-search { margin-bottom: var(--space-4); }
.project-search input { margin-top: var(--space-2); }
.skeleton { min-height: 78px; border-radius: var(--radius-md); background: var(--color-surface-offset); animation: breathe 1.4s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: .4; } }
.noscript-note { position: fixed; inset: 30% 10% auto; z-index: 100; padding: var(--space-6); background: var(--color-surface); border: 1px solid var(--color-border); }
@media (min-width: 1440px) { .workbench { grid-template-columns: minmax(0,1fr) 348px; } .action-notice { right: 364px; } .tab-panel { padding-inline: var(--space-6); } }
@media (max-width: 1100px) {
  .app-header { padding-inline: var(--space-5); gap: var(--space-5); }
  .workspace-label { gap: var(--space-5); }
  .project-bar { padding-inline: var(--space-5); }
  .canvas-toolbar { padding-inline: var(--space-4); gap: var(--space-2); }
  .segmented.view-controls button { padding-inline: var(--space-2); }
  .canvas-actions .button { padding-inline: var(--space-2); }
  .sequence-panel { padding-inline: var(--space-4); }
  .sequence-controls { gap: var(--space-3); }
  .sequence-presets { min-width: 310px; }
  .sequence-presets button { padding-inline: var(--space-2); font-size: var(--text-xs); }
  .app-footer { padding-inline: var(--space-5); align-items: center; }
  .app-footer p:first-child { max-width: 600px; }
  .app-footer p:last-child { max-width: 275px; }
}
@media (max-width: 900px) {
  .workspace-label { display: none; }
  .history-actions .desktop-only { display: none; }
  .project-actions { gap: var(--space-1); }
  .app-footer { min-height: 64px; }
  .app-footer p:first-child { max-width: 390px; }
  .app-footer button { text-align: left; min-height: 44px; }
}
@media (orientation: portrait) and (min-width: 601px), (max-width: 760px) {
  .workbench { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(280px, 1.05fr) minmax(240px, 1fr); }
  .canvas-toolbar { padding-top: var(--space-3); }
  .stage { min-height: 130px; }
  .canvas-caption { top: var(--space-2); }
  .sequence-panel { padding-block: var(--space-2) var(--space-3); }
  .sequence-heading { display: none; }
  .sequence-presets { min-width: 330px; }
  .inspector { border-left: 0; border-top: 1px solid var(--color-border); }
  .inspector-tabs { min-height: 48px; padding-inline: var(--space-5); }
  .inspector-tabs button { font-size: var(--text-sm); }
  .tab-panel { padding: var(--space-5) var(--space-6); }
  #panel-shape, #panel-function, #panel-materials { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-6); align-items: start; }
  .panel-intro { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1) var(--space-6); margin-bottom: var(--space-4); }
  .panel-intro .eyebrow { grid-column: 1; }
  .panel-intro h2 { grid-column: 1; margin-top: 0; }
  .panel-intro p:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; margin-top: 0; }
  .tab-panel > .quiet-note, .tab-panel > .inline-error { grid-column: 1 / -1; }
  #panel-materials .material-swatches { grid-column: 2; grid-row: 2 / 5; }
  #panel-materials #material-selection { grid-column: 2; }
  #panel-project .project-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-5); }
  #panel-project .project-fields > label:has(textarea) { grid-column: 1 / -1; }
  .reference-list { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .empty-references { grid-column: 1 / -1; }
  .inspector-footer { min-height: 32px; padding-block: var(--space-1); }
  .action-notice { right: var(--space-4); bottom: var(--space-4); }
  .app-footer { min-height: 56px; }
  body.is-presenting .workbench { grid-template-rows: minmax(0,1fr); }
}
@media (max-width: 600px) {
  body { overflow: auto; height: auto; min-height: 100dvh; }
  .app-header { min-height: 68px; padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .brand { gap: var(--space-2); }
  .brand-mark { width: 27px; height: 32px; }
  .brand-type > span:first-child { font-size: var(--text-base); }
  .brand-type > span:last-child { font-size: var(--text-xs); letter-spacing: .07em; }
  .header-actions { gap: 0; }
  .header-actions .button { padding-inline: var(--space-2); }
  #button-new { font-size: 0; }
  #button-new > span { font-size: var(--text-lg); }
  #button-new::after { content: 'New'; font-size: var(--text-xs); }
  #button-help { display: none; }
  .header-actions .icon-button { flex-basis: 40px; width: 44px; }
  .desktop-only { display: none !important; }
  .project-bar { min-height: 112px; flex-wrap: wrap; padding: var(--space-3); gap: var(--space-2); }
  .project-heading { flex-basis: 100%; }
  .project-heading h1 { max-width: none; font-size: var(--text-xl); }
  .project-actions { width: 100%; gap: var(--space-2); }
  .history-actions { margin-right: auto; }
  .project-actions > .button { min-width: 82px; }
  .workbench { display: flex; flex-direction: column; }
  .canvas-panel { height: 360px; flex-shrink: 0; }
  .canvas-toolbar { padding: var(--space-3) var(--space-3) 0; gap: var(--space-1); }
  .view-controls { padding: 2px; gap: 0; }
  .segmented.view-controls button { padding-inline: var(--space-1); min-width: 44px; font-size: var(--text-xs); }
  .canvas-actions .button { font-size: var(--text-xs); padding-inline: var(--space-1); }
  #button-dimensions { font-size: 0; }
  #button-dimensions::after { content: 'Dims'; font-size: var(--text-xs); }
  .canvas-caption { left: var(--space-3); right: var(--space-3); top: var(--space-2); }
  .canvas-caption > span:first-child { letter-spacing: .04em; }
  .sequence-panel { padding-inline: var(--space-3); }
  .sequence-controls { gap: var(--space-2); }
  .sequence-presets { min-width: 0; flex: 1; }
  .sequence-presets button { min-width: 0; padding-inline: var(--space-2); }
  .sequence-slider { flex: 0 0 56px; min-width: 56px; }
  .inspector { min-height: 430px; max-height: none; }
  .inspector-tabs { padding-inline: var(--space-2); position: sticky; top: 0; z-index: 3; background: var(--color-surface); }
  .inspector-scroll { overflow: visible; }
  .tab-panel { padding: var(--space-5); }
  #panel-shape, #panel-function, #panel-materials { display: block; }
  .panel-intro { display: block; margin-bottom: var(--space-5); }
  .panel-intro h2 { margin-top: var(--space-2); }
  .panel-intro p:last-child { margin-top: var(--space-2); }
  .number-unit > input { min-height: 48px; }
  #panel-project .project-fields, .reference-list { display: block; }
  .reference-card { margin-bottom: var(--space-3); }
  .reference-card summary strong { max-width: 220px; }
  .material-swatch img { height: 70px; }
  .inspector-footer { min-height: 44px; }
  .app-footer { display: block; padding: var(--space-3) var(--space-5); }
  .app-footer p:first-child { max-width: none; }
  .app-footer button { min-height: 44px; }
  .app-footer p:last-child { text-align: left; max-width: none; border-top: 1px solid var(--color-divider); padding-top: var(--space-3); }
  .action-notice { position: fixed; bottom: var(--space-3); left: var(--space-3); right: var(--space-3); }
  .model-fallback { inset: var(--space-8) var(--space-3) var(--space-6); gap: var(--space-3); }
  .model-fallback > img { width: 38%; }
  .model-fallback figcaption { gap: var(--space-1); }
  .model-fallback figcaption .muted { display: none; }
  .model-fallback figcaption strong { font-size: var(--text-sm); }
  dialog { padding: var(--space-5); width: calc(100vw - 24px); }
  .dialog-header .eyebrow { letter-spacing: .05em; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  body.is-presenting { height: 100dvh; overflow: hidden; }
  body.is-presenting .app-main, body.is-presenting .workbench { flex: 1; min-height: 0; }
  body.is-presenting .canvas-panel { height: auto; flex: 1; }
  body.is-presenting .project-bar { min-height: 112px; padding-right: var(--space-3); align-items: flex-start; }
  body.is-presenting .project-heading h1 { font-size: var(--text-lg); }
  .exit-presentation { top: var(--space-3); right: var(--space-3); font-size: var(--text-xs); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* Public Table Designer: retain the workshop palette and type system. */
[data-workspace-mode="public"] .brand { color: var(--color-text); text-decoration: none; }
[data-workspace-mode="public"] .app-header { gap: var(--space-4); }
[data-workspace-mode="public"] .workspace-label { gap: var(--space-4); flex-shrink: 0; }
[data-workspace-mode="public"] .header-actions { margin-left: 0; }
[data-workspace-mode="public"] .site-nav { display: flex; align-items: center; gap: var(--space-4); margin-left: auto; }
[data-workspace-mode="public"] .site-nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--color-text-muted); text-decoration: none; white-space: nowrap; font-size: var(--text-xs); }
[data-workspace-mode="public"] .site-nav a:hover { color: var(--color-primary); text-decoration: underline; text-underline-offset: 4px; }
[data-workspace-mode="public"] .discuss-button { color: var(--color-primary); text-decoration: underline; text-underline-offset: 4px; }
[data-workspace-mode="public"] .save-state { flex-wrap: wrap; }
[data-workspace-mode="public"] .save-state[data-state="temporary"] .state-dot,
[data-workspace-mode="public"] .status-dot[data-state="temporary"] { background: var(--color-primary); }
[data-workspace-mode="public"] .app-footer { padding-block: var(--space-2); }
[data-workspace-mode="public"] .app-footer button { text-align: left; }
[data-workspace-mode="public"] .dialog-actions a { text-decoration: none; }
[data-workspace-mode="public"] .designer-welcome-photo { margin-bottom: var(--space-5); }
[data-workspace-mode="public"] .designer-welcome-photo img { width: 100%; height: clamp(110px, 18dvh, 180px); object-fit: contain; border-radius: var(--radius-sm); background: var(--color-surface-offset); }
[data-workspace-mode="public"] .designer-welcome-photo figcaption { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-2); }
[data-workspace-mode="public"] #welcome-storage-note { margin-top: var(--space-4); }
[data-workspace-mode="public"] .discussion-label { font-weight: 500; margin-bottom: var(--space-2); }
[data-workspace-mode="public"] .discussion-summary { font-size: var(--text-sm); min-height: 220px; max-height: 45dvh; }
[data-workspace-mode="public"] #discussion-status:empty { display: none; }
[data-workspace-mode="public"] #discussion-status { color: var(--color-primary); margin-top: var(--space-3); }
[data-workspace-mode="public"] #button-save-copy { white-space: normal; }
@media (max-width: 1100px) {
  [data-workspace-mode="public"] .app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); }
  [data-workspace-mode="public"] .brand { grid-column: 1; grid-row: 1; }
  [data-workspace-mode="public"] .site-nav { grid-column: 2; grid-row: 1; }
  [data-workspace-mode="public"] .workspace-label { grid-column: 1; grid-row: 2; display: flex; }
  [data-workspace-mode="public"] .header-rule { display: none; }
  [data-workspace-mode="public"] .header-actions { grid-column: 2; grid-row: 2; justify-content: flex-end; }
}
@media (min-width: 601px) and (max-height: 760px) {
  [data-workspace-mode="public"] body { height: auto; min-height: 100dvh; overflow: auto; }
  [data-workspace-mode="public"] .workbench { min-height: 540px; }
  [data-workspace-mode="public"] .inspector-scroll { max-height: 570px; }
  [data-workspace-mode="public"] body.is-presenting { height: 100dvh; overflow: hidden; }
  [data-workspace-mode="public"] body.is-presenting .workbench { min-height: 0; }
}
@media (max-width: 600px) {
  [data-workspace-mode="public"] .app-header { gap: var(--space-1) var(--space-2); }
  [data-workspace-mode="public"] .brand { grid-row: 1; grid-column: 1 / -1; padding-block: var(--space-1); }
  [data-workspace-mode="public"] .site-nav { grid-row: 2; grid-column: 1 / -1; margin-left: 0; gap: var(--space-5); }
  [data-workspace-mode="public"] .site-nav a { font-size: var(--text-sm); }
  [data-workspace-mode="public"] .workspace-label { grid-row: 3; grid-column: 1; font-size: var(--text-sm); }
  [data-workspace-mode="public"] .workspace-label small { display: none; }
  [data-workspace-mode="public"] .header-actions { grid-row: 3; grid-column: 2; }
  [data-workspace-mode="public"] #button-help { display: inline-flex; }
  [data-workspace-mode="public"] .header-actions .button { padding-inline: var(--space-1); }
  [data-workspace-mode="public"] .project-actions { flex-wrap: wrap; }
  [data-workspace-mode="public"] .discuss-button { order: 4; flex-basis: 100%; justify-content: flex-start; padding-inline: 0; }
  [data-workspace-mode="public"] .history-actions { margin-right: auto; }
  [data-workspace-mode="public"] .app-footer { padding: var(--space-3) var(--space-5); }
  [data-workspace-mode="public"] .dialog-actions { flex-direction: column; }
  [data-workspace-mode="public"] .model-fallback figcaption .muted { display: block; }
  [data-workspace-mode="public"] .canvas-panel:has(.model-fallback:not([hidden])) { min-height: 440px; }
}
@media (max-width: 359px) {
  [data-workspace-mode="public"] .workspace-label { grid-column: 1 / -1; }
  [data-workspace-mode="public"] .header-actions { grid-row: 4; grid-column: 1 / -1; justify-content: flex-start; }
}

[data-workspace-mode="public"] dialog[data-kind="welcome"] .dialog-actions { position: sticky; bottom: calc(-1 * var(--space-6)); background: var(--color-surface); padding-block: var(--space-3); margin-bottom: calc(-1 * var(--space-3)); z-index: 2; }
@media (max-width: 600px) {
  [data-workspace-mode="public"] .designer-welcome-photo img { height: 110px; }
  [data-workspace-mode="public"] dialog[data-kind="welcome"] .dialog-actions { bottom: calc(-1 * var(--space-5)); }
}

/* Public notices occupy their own row, never covering the sequence controls. */
[data-workspace-mode="public"] .action-notice {
  position: static;
  inset: auto;
  flex-shrink: 0;
  margin: 0;
  padding: var(--space-2) var(--space-6);
  border-inline: 0;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}
@media (max-width: 600px) {
  [data-workspace-mode="public"] .action-notice { padding-inline: var(--space-3); }
}
