:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Segoe UI", "PingFang SC", sans-serif;
  color: #18211c;
  background: #eef2ef;
  --color-action-primary: #236641;
  --color-action-primary-hover: #195537;
  --color-surface: #ffffff;
  --color-surface-soft: #f8faf8;
  --color-border: #dbe4de;
  --color-text-muted: #5d6d64;
  --color-warning: #a85b12;
  --color-warning-surface: #fff7e9;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 78% -12%, #ffffff 0, #f4f7f4 40%, #eef2ef 100%); }
[hidden] { display: none !important; }

.shell { width: min(1640px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 56px; }
header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 22px; }
h1 { font-size: 32px; margin: 4px 0 8px; letter-spacing: -.6px; }
h2 { font-size: 16px; margin: 0 0 11px; }
p { margin: 0; }
.eyebrow, .workflow-kicker { font-size: 11px; letter-spacing: 1.2px; font-weight: 700; color: #75817b; }
.subtle, .footnote, .status, .empty, .control-hint { color: #66716d; font-size: 13px; line-height: 1.55; }
.badge, .precision, .unit-badge { border: 1px solid #cdd8d2; padding: 8px 11px; border-radius: 99px; font-size: 12px; color: #3e6452; background: #f7fbf8; white-space: nowrap; }
.unit-badge { display: inline-flex; margin-top: 2px; }

.layout { display: grid; grid-template-columns: 332px minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: 0 12px 32px rgba(27, 48, 38, .055); }
.controls { padding: 21px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; grid-template-rows: auto minmax(0, 1fr) auto; }
.controls h2:not(:first-of-type) { margin-top: 25px; }
.workflow-kicker { margin: 0 0 7px; }

.drop-zone { display: flex; cursor: pointer; min-height: 128px; padding: 18px; text-align: center; border: 1.5px dashed #a7bdb0; border-radius: 12px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: #315e48; background: #f8fcf9; }
.drop-zone:hover { border-color: #4d9870; background: #f2faf4; }
.drop-zone input { display: none; }
.drop-zone span { color: #708079; font-size: 12px; line-height: 1.5; }
.status { margin-top: 10px; min-height: 20px; }

.section-list { display: grid; gap: 8px; }
#product-list { max-height: 200px; overflow: auto; }
.template-control { display: grid; gap: 8px; margin-top: 11px; padding: 10px; border: 1px solid #dce7df; border-radius: 10px; background: #f7fbf8; }
.section-card, .composition-slot { appearance: none; width: 100%; border: 1px solid #e1e8e3; border-radius: 10px; padding: 10px; text-align: left; background: #fff; cursor: pointer; color: #2d3832; }
.section-card:hover, .section-card.active, .composition-slot:hover, .composition-slot.active { border-color: #4d9870; background: #f4faf6; }
.section-card strong, .composition-slot strong { display: block; font-size: 13px; }
.section-card span, .composition-slot span { display: block; font-size: 11px; color: #718078; margin-top: 3px; }
.section-card .recognition-summary { display: block; margin-top: 4px; color: #4f7661; font-size: 11px; }
.composition-slot.active { box-shadow: inset 3px 0 0 #d98225; border-color: #dba05a; background: #fffaf1; }
.composition-heading { color: #5d6b64; font-size: 12px; line-height: 1.55; padding: 2px 1px; }
.composition-warning { color: #885516; background: #fff8eb; border: 1px solid #efd2a6; border-radius: 8px; padding: 9px; font-size: 11px; line-height: 1.5; }

.field { display: grid; gap: 7px; color: #405048; font-size: 13px; margin-bottom: 14px; }
.field select, .field input { width: 100%; accent-color: #34734f; }
.field select, .material-control select { border: 1px solid #d9e2dc; border-radius: 8px; padding: 9px; background: white; }
.camera-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0 0 14px; }
.camera-presets button { border: 1px solid #d8e3dc; background: #fbfdfb; border-radius: 8px; padding: 8px 6px; cursor: pointer; color: #395247; font: inherit; font-size: 12px; }
.camera-presets button:hover { border-color: #4d9870; background: #f2faf4; }
.camera-presets button.active { border-color: #2f7a53; background: #eaf6ee; color: #1e6040; font-weight: 700; }
.control-hint { font-size: 11px; padding: 9px 10px; background: #f8faf8; border-left: 3px solid #d99b55; border-radius: 0 8px 8px 0; margin: 1px 0 2px; }

.primary { width: 100%; min-height: 44px; border: 0; background: var(--color-action-primary); color: white; font: inherit; border-radius: 9px; padding: 10px 12px; cursor: pointer; }
.primary:hover:not(:disabled) { background: var(--color-action-primary-hover); }
.primary:disabled { cursor: not-allowed; background: #aebbb4; }
.secondary-primary { background: #315f75; }
.secondary-primary:hover:not(:disabled) { background: #264e61; }
.plan-primary { background: #6a546d; }
.plan-primary:hover:not(:disabled) { background: #57445a; }
.action-stack { display: grid; gap: 9px; margin-top: 6px; }
.outline-button { min-height: 44px; border: 1px solid #b8c9be; background: #fff; color: #315e48; font: inherit; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 12px; }
.outline-button:hover:not(:disabled), .outline-button.active { border-color: #d98225; background: var(--color-warning-surface); color: var(--color-warning); }
.outline-button:disabled { color: #9aa6a0; background: #f4f6f4; cursor: not-allowed; }

.material-card { display: grid; gap: 7px; border: 1px solid #e1e8e3; border-radius: 10px; padding: 11px; background: #fbfdfb; }
.material-card strong { color: #2d3832; font-size: 13px; }
.material-card.active { border-color: #dba05a; box-shadow: inset 3px 0 0 #d98225; background: #fffdf8; }
.selected-slot-properties { border-color: #dfb270; background: #fffdf8; }
.material-detail, .material-hint { color: #718078; font-size: 11px; line-height: 1.45; }
.material-control { display: grid; gap: 6px; color: #405048; font-size: 12px; }
.color-control { grid-template-columns: 1fr 50px; align-items: center; }
.color-control input[type="color"] { width: 50px; height: 32px; padding: 2px; border: 1px solid #d9e2dc; border-radius: 7px; background: white; cursor: pointer; }
.advanced-structure { border: 1px solid #e1e8e3; border-radius: 9px; padding: 9px 10px; color: #5e6d65; font-size: 12px; line-height: 1.5; }
.advanced-structure summary { cursor: pointer; font-weight: 700; color: #405048; }
.advanced-structure p { margin-top: 7px; }

.material-workbench { display: grid; gap: 8px; margin-bottom: 8px; }
.material-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.material-token { appearance: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d7e2da; border-radius: 99px; padding: 6px 10px; background: #fff; color: #35463d; font: inherit; font-size: 11px; cursor: grab; user-select: none; }
.material-token:active { cursor: grabbing; }
.material-token::before { content: ''; width: 10px; height: 10px; border: 1px solid rgba(32, 40, 37, .18); border-radius: 50%; background: var(--material-swatch); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.material-token:hover { border-color: #4d9870; background: #f4faf6; }
.planar-actions { display: grid; grid-template-columns: 1.8fr repeat(3, minmax(0, 1fr)); gap: 6px; }
.planar-actions .primary { padding: 8px; font-size: 12px; }
.material-region-list { display: grid; gap: 6px; margin-top: 8px; }
.material-region-list .material-card { padding: 8px 9px; gap: 4px; cursor: pointer; }
.material-region-list .material-card strong { font-size: 12px; }
.material-region-list .material-detail, .material-region-list .material-hint { font-size: 10px; }
.material-colour-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #52615b; font-size: 10px; }
.material-colour-field input[type="color"] { width: 36px; height: 24px; padding: 1px; border: 1px solid #d1ddd5; border-radius: 6px; background: #fff; cursor: pointer; }
.material-card.staged { border-color: #dba05a; background: #fffaf1; }
.staged-material { color: #9b5b12; font-size: 11px; font-weight: 700; }

.workspace { padding: 24px; }
.workspace-heading, .preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.workspace-heading { margin-bottom: 15px; }
.workspace-heading h2, .preview-heading h2 { margin-bottom: 4px; }
.workspace-heading p, .preview-heading p { color: #66716d; font-size: 13px; line-height: 1.55; }
.engineering-check { padding: 16px; border: 1px solid #e5ebe7; border-radius: 12px; background: linear-gradient(145deg, #fcfdfc, #f6f9f7); }
.engineering-canvases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.engineering-view { min-width: 0; margin: 0; }
.engineering-view figcaption { display: grid; gap: 3px; min-height: 39px; margin: 0 0 7px; color: #405048; font-size: 12px; }
.engineering-view figcaption strong { font-size: 12px; }
.engineering-view figcaption span { color: #7e8b84; font-weight: 400; }
.engineering-view canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; background: white; border: 1px solid #edf0ee; border-radius: 8px; cursor: crosshair; }
.engineering-view canvas:focus-visible { outline: 3px solid rgba(217, 130, 37, .35); outline-offset: 3px; }
.wireframe-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 9px; padding: 11px; border: 1px solid #e0e8e2; border-radius: 10px; background: #fbfdfb; }
.wireframe-controls .field { margin: 0; font-size: 11px; }
.wireframe-controls .field span { font-size: 11px; color: #62736a; }
.studio-standard-card { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid #c6ddce; border-radius: 9px; background: linear-gradient(108deg, #f1f9f3, #f9fcfa); }
.studio-standard-card strong, .studio-standard-card span { display: block; }
.studio-standard-card strong { color: #1c593b; font-size: 13px; }
.studio-standard-card span { margin-top: 3px; color: #587065; font-size: 11px; }
.studio-standard-card em { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #dcefe1; color: #256443; font-size: 11px; font-style: normal; font-weight: 700; }
.composition-toggle { grid-column: span 2; width: 100%; }
.camera-adjustment-controls { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 11px; border: 1px solid #ead5b6; border-radius: 9px; background: #fffaf2; }
.camera-adjustment-controls .field { margin: 0; }
.wireframe-controls .control-hint { grid-column: 1 / -1; margin: 0; }

.render-workspace { margin-top: 19px; padding-top: 18px; border-top: 1px solid #e5ebe7; }
.preview-heading { margin-bottom: 12px; }
.render-stage { position: relative; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; background: white; border-radius: 12px; overflow: hidden; }
.fast-preview-card, .blender-preview-card { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 7px; }
.fast-preview-card > p, .blender-preview-card > p { margin: 0; color: #53625c; font-size: 12px; font-weight: 700; }
#fast-preview-canvas, #blender-preview, .render-placeholder { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: white; border: 1px solid #edf0ee; border-radius: 12px; }
.render-placeholder { display: grid; place-items: center; color: #708079; font-size: 14px; background: linear-gradient(145deg, #fafbf9, #eef2ef); padding: 30px; text-align: center; }
.render-stale { position: absolute; inset: auto 16px 16px 16px; padding: 10px 12px; background: rgba(44, 52, 48, .84); color: white; border-radius: 8px; font-size: 12px; text-align: center; pointer-events: none; }
.footnote { margin: 12px 2px 0; }

/* Desktop workbench: every core workflow stage remains visible together. */
@media (min-width: 851px) {
  .shell { width: min(1720px, calc(100% - 36px)); padding: 18px 0 24px; }
  header { align-items: center; margin-bottom: 14px; }
  h1 { font-size: 27px; margin: 3px 0 4px; }
  .subtle { font-size: 12px; }

  .layout { grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: stretch; }
  .controls, .workspace { height: calc(100vh - 130px); min-height: 620px; max-height: 840px; }
  .controls { display: grid; gap: 12px; padding: 16px; overflow: hidden; }
  .controls h2, .controls h2:not(:first-of-type) { margin: 0 0 8px; }
  .import-step { min-width: 0; }
  .workflow-kicker { margin: 0 0 6px; }
  .drop-zone { min-height: 86px; padding: 11px; gap: 4px; }
  .drop-zone span { font-size: 11px; }
  .status { margin-top: 7px; font-size: 12px; }
  .product-step { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  #product-list { min-height: 0; max-height: none; overflow: auto; padding-right: 2px; }
  .export-step { padding-top: 11px; border-top: 1px solid #e5ebe7; }
  .action-stack { gap: 7px; }

  .workspace { display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 16px; }
  .workspace-heading { margin-bottom: 10px; }
  .workspace-heading h2 { margin-bottom: 2px; }
  .workspace-heading p { font-size: 12px; }
  .precision { padding: 6px 9px; }
  .workbench-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(272px, .82fr); gap: 12px; }
  .workbench-pane, .preview-pane { min-width: 0; min-height: 0; border: 1px solid #e2e9e4; border-radius: 12px; background: linear-gradient(145deg, #fcfdfc, #f6f9f7); box-shadow: 0 8px 20px rgba(27, 48, 38, .035); }
  .material-pane { overflow: hidden; }
  .material-view { height: 100%; display: grid; grid-template-rows: auto auto minmax(230px, 1fr) auto; gap: 8px; padding: 12px; }
  .engineering-view figcaption { min-height: 0; margin: 0; }
  .material-workbench { margin: 0; }
  .material-palette { max-height: 96px; overflow: auto; padding-right: 3px; }
  .material-token { min-height: 44px; padding: 6px 8px; font-size: 10px; }
  .planar-actions { grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); }
  .material-view canvas { width: min(100%, 430px); height: auto; max-height: 100%; justify-self: center; align-self: center; }
  .material-region-list { min-height: 66px; max-height: 92px; overflow: auto; margin: 0; padding-right: 3px; }

  .preview-column { min-height: 0; display: grid; grid-template-rows: minmax(0, 1.06fr) minmax(0, .94fr); gap: 12px; }
  .composition-pane { display: grid; grid-template-rows: auto auto auto; align-content: start; gap: 8px; padding: 12px; overflow: auto; }
  .composition-pane canvas { width: min(100%, 185px); height: auto; justify-self: center; }
  .wireframe-controls { grid-template-columns: 1fr; gap: 7px; margin: 0; padding: 9px; }
  .studio-standard-card { padding: 8px 9px; }
  .studio-standard-card strong { font-size: 12px; }
  .studio-standard-card span { font-size: 10px; }
  .studio-standard-card em { padding: 4px 6px; font-size: 10px; }
  .composition-toggle { grid-column: auto; }
  .wireframe-controls .control-hint { grid-column: auto; padding: 7px 8px; font-size: 10px; }
  .camera-adjustment-controls { grid-template-columns: 1fr; }

  .preview-pane { display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 12px; overflow: hidden; }
  .preview-heading { margin-bottom: 7px; }
  .preview-heading h2 { font-size: 13px; margin-bottom: 1px; }
  .preview-heading p { font-size: 10px; line-height: 1.35; }
  .render-stage { min-height: 0; }
  #fast-preview-canvas, #blender-preview, .render-placeholder { width: min(100%, 220px); max-height: 100%; aspect-ratio: 1; }
  .render-placeholder { font-size: 12px; padding: 18px; }
  .footnote { margin: 7px 2px 0; font-size: 10px; line-height: 1.35; }
}

button:focus-visible, input:focus-visible, .drop-zone:focus-within { outline: 3px solid rgba(35, 102, 65, .35); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 1120px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
  .controls { padding: 14px; }
  .workbench-grid { grid-template-columns: minmax(0, 1.08fr) minmax(260px, .92fr); }
  .material-view canvas { width: min(100%, 360px); }
  .composition-pane canvas { width: min(100%, 160px); }
  #blender-preview, .render-placeholder { width: min(100%, 180px); }
}

@media (max-width: 850px) {
  .shell { width: min(100% - 28px, 760px); padding-top: 24px; }
  .layout { grid-template-columns: 1fr; }
  .controls, .workspace { position: static; height: auto; min-height: 0; max-height: none; }
  .controls { display: block; overflow: visible; }
  .controls h2:not(:first-of-type) { margin-top: 25px; }
  #product-list { max-height: 200px; }
  header, .workspace-heading, .preview-heading { flex-direction: column; }
  .workbench-grid, .preview-column { display: grid; grid-template-columns: 1fr; gap: 15px; }
  .workbench-pane, .preview-pane { padding: 13px; border: 1px solid #e2e9e4; border-radius: 12px; background: linear-gradient(145deg, #fcfdfc, #f6f9f7); }
  .wireframe-controls { grid-template-columns: 1fr; }
  .composition-toggle, .wireframe-controls .control-hint { grid-column: auto; }
  .engineering-view canvas { max-width: 560px; }
  .camera-adjustment-controls { grid-template-columns: 1fr; }
  .composition-toggle { grid-column: 1 / -1; }
}

/* Industrial desktop workbench: neutral, precise, product-first. */
:root {
  --paper: #f5f5f2;
  --panel: #fbfbf9;
  --ink: #252724;
  --muted: #727671;
  --line: #d9dad5;
  --accent: #bd342b;
  --accent-dark: #9f251e;
}

body { min-width: 920px; background: var(--paper); color: var(--ink); font-family: Inter, "IBM Plex Sans", "Helvetica Neue", "Microsoft YaHei UI", sans-serif; }
button, input, output { font: inherit; }
.desktop-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  grid-template-rows: 52px minmax(0, 1fr) 56px;
  grid-template-areas:
    "top top top"
    "tree viewport inspector"
    "bottom bottom bottom";
  background: var(--paper);
}
.desktop-shell.render-active { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "top top" "viewport inspector" "bottom bottom"; }
.desktop-shell.render-active .project-tree-panel { display: flex; }
.desktop-shell.render-active .project-tree-panel .tree-section:first-child { display: block; }
.desktop-shell.render-active .tree-section.tree-grow { min-height: 0; padding: 12px 8px; }
.desktop-shell.render-active .tree-heading { margin-left: 4px; }
.desktop-shell.render-active .tree-product { display: block; padding: 3px 0; border-left: 0; }
.desktop-shell.render-active .tree-product.selected { background: transparent; }
.desktop-shell.render-active .tree-product-button { min-height: 34px; padding: 0 8px; border: 1px solid transparent; font-size: 11px; }
.desktop-shell.render-active .tree-product.selected .tree-product-button { border-color: var(--accent); background: #fff; color: var(--accent); }
.desktop-shell.render-active .tree-recognition,
.desktop-shell.render-active .tree-branch,
.desktop-shell.render-active .tree-region-button,
.desktop-shell.render-active .tree-eye { display: none; }
.app-toolbar { grid-area: top; display: grid; grid-template-columns: 300px minmax(0, 1fr) auto; align-items: stretch; gap: 18px; padding: 0 16px; background: #fcfcfa; border-bottom: 1px solid var(--line); }
.brand-lockup, .toolbar-actions, .module-tabs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-lockup strong { font-size: 12px; letter-spacing: .75px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; background: #2c2d2a; color: #fff; font-size: 9px; font-weight: 800; letter-spacing: -.5px; }
.offline-indicator { color: var(--muted); font-size: 9px; letter-spacing: .9px; border-left: 1px solid var(--line); padding-left: 8px; }
.module-tabs { justify-content: center; overflow: hidden; }
.module-tab { position: relative; height: 52px; border: 0; background: transparent; color: #595d58; padding: 0 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.module-tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: transparent; }
.module-tab.active { color: var(--ink); font-weight: 700; }
.module-tab.active::after { background: var(--accent); }
.toolbar-actions { justify-content: flex-end; }
.toolbar-button, .render-button { min-height: 29px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #555954; padding: 5px 9px; font-size: 11px; cursor: pointer; }
.toolbar-button:disabled { color: #a6a9a4; background: #f5f5f2; cursor: not-allowed; }
.render-button { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 700; letter-spacing: .5px; }
.render-button:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.render-button:disabled { border-color: #d8bab7; background: #d8bab7; color: #f9eeee; cursor: not-allowed; }
.export-inspector > .export-quality,
.export-inspector > .export-aspects,
.export-inspector > .status-check,
.export-inspector > .export-directory,
.export-inspector > .control-hint { display: none; }
.export-dialog { width: min(620px, calc(100vw - 32px)); padding: 0; border: 1px solid #c9cdc8; border-radius: 5px; background: #fbfbf9; color: var(--ink); box-shadow: 0 18px 52px rgba(22, 25, 22, .22); }
.export-dialog::backdrop { background: rgba(32, 35, 32, .32); }
.export-dialog-card { display: grid; gap: 20px; padding: 22px; }
.export-dialog-card > header, .export-dialog-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.export-dialog-card header p { margin: 0 0 4px; color: #7b807a; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.export-dialog-card h2, .export-dialog-card h3 { margin: 0; }
.export-dialog-card h2 { font-size: 17px; }
.export-dialog-card h3 { margin-bottom: 9px; color: #5e635d; font-size: 11px; }
.export-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.export-dialog-grid section { padding: 14px; border: 1px solid var(--line); background: #fff; }
.export-dialog .export-quality, .export-dialog .export-aspects { display: flex; flex-wrap: wrap; gap: 7px; }
.export-dialog .status-check { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; }
.export-location { display: grid; gap: 8px; }
.export-location label { display: flex; align-items: center; gap: 7px; color: #4d524c; font-size: 12px; }
.export-location input[type="text"] { min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; }
.export-dialog-note { margin: 0; padding-left: 10px; border-left: 2px solid #c99055; color: #6f746e; font-size: 11px; line-height: 1.55; }
@media (max-width: 650px) { .export-dialog-grid { grid-template-columns: 1fr; } }

.project-tree-panel { grid-area: tree; min-height: 0; overflow: auto; background: #f8f8f6; border-right: 1px solid var(--line); }
.tree-section { padding: 15px 13px; border-bottom: 1px solid var(--line); }
.tree-grow { min-height: 260px; }
.tree-heading { margin: 0 0 9px; color: #7d807b; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
.camera-tree-heading { margin-top: 18px; }
.import-design-control { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 9px; border: 1px dashed #aeb1aa; border-radius: 4px; color: #3f443f; cursor: pointer; font-size: 12px; }
.import-design-control:hover { border-color: var(--accent); color: var(--accent); }
.import-design-control input { display: none; }
.import-glyph { color: var(--accent); font-size: 17px; line-height: 1; }
.project-tree { display: grid; gap: 2px; }
.project-tree .empty { padding: 8px 2px; font-size: 11px; }
.compact-product { width: 100%; min-height: 34px; padding: 0 9px; border: 1px solid transparent; background: transparent; color: #3f433f; text-align: left; font-size: 12px; font-weight: 700; }
.compact-product:hover, .compact-product.selected { border-color: #cdd1cc; background: #fff; color: #20231f; }
.static-tree-item, .tree-node { display: flex; align-items: center; gap: 7px; min-height: 27px; color: #4b4e49; font-size: 12px; }
.static-tree-item span:first-child { color: #949892; font-size: 11px; }
.tree-eye { margin-left: auto; color: #989b96; font-size: 9px; }
.tree-product { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 5px 3px 2px; border-left: 2px solid transparent; }
.tree-product.selected { border-left-color: var(--accent); background: #f0f0ed; }
.tree-product-button, .tree-region-button, .tree-branch { appearance: none; width: 100%; border: 0; background: transparent; padding: 3px 4px; color: #343734; text-align: left; cursor: pointer; font-size: 12px; }
.tree-product-button { font-weight: 700; }
.tree-branch { color: #777b75; font-size: 11px; cursor: default; }
.tree-region-button { padding-left: 18px; color: #666b65; font-size: 11px; }
.tree-region-button.selected { color: var(--accent); font-weight: 700; }
.tree-recognition { grid-column: 1 / -1; padding-left: 4px; color: #7b8079; font-size: 10px; }
.tree-warning { color: #a56419; }
.legacy-product-list { display: none; }

.viewport-panel { grid-area: viewport; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); background: #ececea; }
.viewport-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--line); background: #f7f7f5; }
.viewport-camera-readout { display: grid; gap: 1px; color: #535752; font-size: 10px; letter-spacing: .7px; }
.viewport-camera-readout span { color: #878b85; font-size: 10px; letter-spacing: 0; }
.viewport-actions { display: flex; align-items: center; gap: 3px; }
.view-button { border: 1px solid transparent; border-radius: 3px; background: transparent; color: #696d67; padding: 4px 7px; font-size: 10px; cursor: pointer; }
.view-button:hover, .view-button.active { border-color: #c9cbc6; background: #fff; color: #333632; }
.viewport-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #e9e9e7; }
#realtime-viewer, #fast-preview-canvas { display: block; width: min(84%, 720px); height: auto; max-height: calc(100vh - 270px); aspect-ratio: 1; border: 0; border-radius: 0; background: #e9e9e7; object-fit: contain; box-shadow: none; }
#realtime-viewer { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: fill; cursor: grab; touch-action: none; }
.viewport-stage #fast-preview-canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
#realtime-viewer:active { cursor: grabbing; }
#realtime-viewer[data-backdrop="transparent"] { background-color: #fff; background-image: linear-gradient(45deg, #e5e7e3 25%, transparent 25%), linear-gradient(-45deg, #e5e7e3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7e3 75%), linear-gradient(-45deg, transparent 75%, #e5e7e3 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.workspace-tabs { display: flex; align-items: end; gap: 0; padding: 9px 14px 0; border-bottom: 1px solid var(--line); background: #f7f7f5; }
.workspace-tab { min-height: 34px; padding: 0 14px; border: 1px solid transparent; border-bottom: 0; background: transparent; color: #696d68; font-size: 12px; font-weight: 700; }
.workspace-tab.active { border-color: #cfd2cd; background: #fff; color: #252825; }
.workspace-panel { min-height: 0; }
.profile-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; padding: 14px; background: #f2f3f1; }
.profile-workspace-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 10px; color: #626660; font-size: 12px; }
.profile-workspace-heading strong { color: #2a2d29; font-size: 14px; }
.profile-workspace #product-canvas { width: min(100%, 760px); height: min(100%, 760px); margin: auto; aspect-ratio: 1; background: #fff; border: 1px solid #cfd4cf; border-radius: 0; cursor: crosshair; }
.profile-workspace-heading > span { display: inline-flex; align-items: center; gap: 8px; }
.profile-workspace-heading .toolbar-button { min-height: 26px; padding: 3px 7px; font-size: 10px; }
.multi-product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-content: start; overflow: auto; padding: 2px; }
.multi-product-card { display: grid; gap: 7px; min-height: 150px; padding: 10px; border: 1px solid #cfd4cf; border-radius: 4px; background: #fff; text-align: left; }
.multi-product-card.selected { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.multi-product-card strong { color: #2d312d; font-size: 12px; }.multi-product-card span { color: #70756f; font-size: 10px; }.multi-product-card canvas { width: 100%; aspect-ratio: 1.7; border: 1px solid #d8dcd7; background: #202a33; }
.render-workspace { display: grid; grid-template-rows: auto minmax(260px, 1fr) auto auto auto; height: 100%; }
.viewport-empty-state { position: absolute; display: grid; gap: 5px; place-items: center; color: #6f736e; font-size: 12px; pointer-events: none; }
.viewport-empty-state strong { color: #3e423e; font-size: 14px; font-weight: 600; }
.viewport-quality-chip { position: static; display: flex; align-items: center; gap: 6px; padding: 5px 15px; border-top: 1px solid var(--line); background: #fafaf8; color: #666a64; font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.blender-calibration { width: 180px; border-top: 1px solid var(--line); background: #f8f8f6; }
.viewport-stage .blender-calibration { position: absolute; z-index: 2; left: 12px; bottom: 12px; box-shadow: 0 4px 15px rgba(21, 26, 23, .16); }
.blender-calibration summary { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 15px; color: #3f433e; cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.blender-calibration summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #7a7e78; font-size: 10px; font-weight: 400; }
.calibration-content { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); aspect-ratio: 1; width: 180px; max-height: 180px; overflow: hidden; }
.calibration-content #blender-preview, .calibration-content .render-placeholder { display: block; width: 100%; height: 100%; justify-self: start; aspect-ratio: 1; border: 0; border-radius: 0; background: #e9e9e7; object-fit: contain; }
.calibration-content .render-placeholder { display: grid; place-items: center; padding: 16px; font-size: 11px; }
.calibration-content .render-stale { position: static; margin: 8px 14px; border-radius: 4px; background: #605f59; font-size: 10px; }
.blender-calibration summary { min-height: 28px; padding: 7px 15px; font-size: 10px; }
.blender-calibration summary span { display: inline; }
.calibration-content .render-placeholder { padding: 10px; }
.calibration-content .render-stale { position: absolute; inset: auto 0 0; margin: 0; border-radius: 0; }
.viewport-footer { display: flex; align-items: center; gap: 18px; padding: 0 15px; border-top: 1px solid var(--line); background: #f7f7f5; color: #858983; font-size: 9px; letter-spacing: .55px; }
.viewport-footer strong { color: #535752; font-size: 9px; margin-left: 3px; }
.viewport-note { padding: 7px 15px; border-top: 1px solid var(--line); background: #fafaf8; color: #767a74; font-size: 10px; line-height: 1.35; }

.inspector-panel { grid-area: inspector; min-height: 0; overflow: auto; background: #fafaf8; border-left: 1px solid var(--line); }
.inspector-group { padding: 14px; border-bottom: 1px solid var(--line); }
.inspector-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.inspector-heading h2 { margin: 0; color: #3c403b; font-size: 11px; letter-spacing: .9px; }
.inspector-heading > span { color: #858983; font-size: 10px; }
.inspector-heading .precision { padding: 3px 5px; border-radius: 3px; background: #f3f3f0; color: #71756f; font-size: 9px; }
.property-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 28px; color: #5d625c; font-size: 11px; }
.optical-transmission-row[hidden] { display: none; }
.optical-transmission-row { grid-template-columns: 120px minmax(0, 1fr) auto; margin: 4px 0 8px; }
.property-row input { min-width: 0; accent-color: var(--accent); }
.property-row output { justify-self: end; color: #333733; font-variant-numeric: tabular-nums; font-size: 10px; white-space: nowrap; }
.range-control { display: grid; grid-template-columns: 20px minmax(0, 1fr) 20px; align-items: center; gap: 3px; }
.range-control button { min-height: 22px; padding: 0; border: 1px solid #c7cbc5; border-radius: 3px; background: #fff; color: #4f544f; font-size: 14px; line-height: 1; }.range-control button:hover { border-color: var(--accent); color: var(--accent); }
.export-directory { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 7px; margin-top: 9px; color: #5d625c; font-size: 11px; }
.export-directory input { min-width: 0; height: 27px; border: 1px solid #cdd1cc; border-radius: 3px; background: #fff; padding: 0 7px; color: #3f433e; font-size: 10px; }
.material-color-swatch { width: 24px; height: 14px; background: #252523; border: 1px solid #171716; }
.material-inspector .material-palette { margin: 10px 0; max-height: 98px; overflow: auto; }
.material-inspector .material-token { min-height: 26px; border-radius: 3px; padding: 4px 6px; font-size: 10px; }
.material-inspector .material-token::before { width: 8px; height: 8px; }
.planar-actions { grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); gap: 4px; }
.primary, .outline-button { min-height: 30px; border-radius: 4px; padding: 5px 4px; font-size: 10px; }
.primary { background: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.outline-button { border-color: #cdd0ca; color: #555a54; }
.material-region-list { max-height: 170px; overflow: auto; margin-top: 9px; }
.material-card { border-radius: 4px; padding: 7px; }
.material-card.active { box-shadow: inset 2px 0 0 var(--accent); border-color: #cdb4b1; }
.light-map { position: relative; height: 76px; margin-top: 9px; border: 1px solid var(--line); background: #f2f2ef; overflow: hidden; }
.light-map::before { content: ""; position: absolute; width: 76px; height: 17px; left: calc(50% - 38px); top: calc(50% - 8px); border: 1px solid #555953; background: #2e312e; transform: skewX(-22deg); }
.light-map span { position: absolute; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 9px; font-weight: 800; }
.light-key { top: 12px; right: 23px; background: var(--accent); }.light-fill { bottom: 12px; left: 30px; background: #787d77; }.light-rim { top: 12px; left: 27px; background: #4a4e49; }
.camera-adjustment-controls { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 6px; padding: 6px 0 0; border: 0; border-top: 1px solid var(--line); background: transparent; }
.camera-adjustment-controls summary { cursor: pointer; color: #5d625c; font-size: 11px; }
.camera-adjustment-controls .property-row { margin-top: 5px; }
.model-rotation-inspector { background: #fffaf2; }
.model-rotation-inspector .inspector-heading h2 { color: #795022; }
.render-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.render-presets button { display: grid; grid-template-columns: 20px 1fr; gap: 4px; align-items: center; min-height: 35px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #62665f; text-align: left; padding: 5px; font-size: 10px; }
.render-presets button.active { border-color: var(--accent); color: #3f302e; box-shadow: inset 0 0 0 1px var(--accent); }
.render-presets b { color: #90948e; font-size: 9px; }
.control-hint { margin: 9px 0 0; padding: 6px 7px; border-left: 2px solid #c3a080; border-radius: 0; background: #f4f3ef; font-size: 10px; }

.render-status-bar { grid-area: bottom; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-top: 1px solid var(--line); background: #f7f7f5; }
.status-controls, .render-actions { display: flex; align-items: center; gap: 5px; }
.status-label { color: #81857f; font-size: 9px; font-weight: 700; letter-spacing: .85px; }
.status-choice { min-height: 24px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #6d716b; padding: 3px 5px; font-size: 10px; }
.status-choice.active { border-color: #babdb7; background: #fff; color: #373a36; }.status-choice:disabled { color: #afb2ac; }
.status-divider { height: 18px; width: 1px; margin: 0 5px; background: var(--line); }.status-check { color: #858983; font-size: 10px; margin-left: 4px; }.status-check input { accent-color: var(--accent); }
.render-actions .render-button { min-width: 118px; }
.toolbar-workspaces { justify-content: center; align-self: stretch; padding: 0; border: 0; background: transparent; }
.toolbar-workspaces .workspace-tab { min-height: 52px; border: 0; border-bottom: 2px solid transparent; background: transparent; }
.toolbar-workspaces .workspace-tab.active { border-bottom-color: var(--accent); color: var(--ink); }
.preview-actions, .export-actions, .export-quality, .export-aspects { display: flex; align-items: center; gap: 6px; }
.preview-actions { margin-top: 10px; }
.preview-actions .primary { flex: 1; }
.export-inspector { display: grid; gap: 9px; }
.export-quality { justify-content: space-between; }
.export-aspects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.export-actions { margin-top: 2px; }
.export-actions .render-button { flex: 1; }
.batch-export-panel { display: grid; gap: 6px; padding: 8px; border: 1px solid #d4d7d1; background: #fafaf8; }.batch-export-panel > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #444943; font-size: 10px; }.batch-export-list { display: grid; gap: 3px; max-height: 106px; overflow: auto; }.batch-export-item { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 4px; border: 1px solid #e0e2dd; background: #fff; color: #5e635d; font-size: 10px; }.batch-export-item small { color: #8a7064; }.batch-export-panel .outline-button { min-height: 28px; }.batch-export-panel .control-hint { margin: 0; }

/* Keep both render references visible in the fixed desktop workbench. */
.desktop-shell.desktop-shell { height: 100vh; overflow: hidden; }
.desktop-shell .viewport-panel { overflow: hidden; }
.desktop-shell .render-workspace { min-height: 0; }
.desktop-shell .calibration-content { max-height: 210px; }
.desktop-shell .calibration-content #blender-preview, .desktop-shell .calibration-content .render-placeholder { width: min(100%, 210px); max-height: 210px; }

@media (max-width: 1100px) { .desktop-shell { grid-template-columns: 0 minmax(0, 1fr) 300px; }.project-tree-panel { display: none; }.app-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; }.brand-lockup strong { display: none; } }
@media (max-width: 850px) { body { min-width: 0; }.desktop-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(420px, 1fr) auto auto; grid-template-areas: "top" "viewport" "inspector" "bottom"; }.app-toolbar { grid-template-columns: 1fr auto; min-height: 52px; }.module-tabs { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; border-top: 1px solid var(--line); }.toolbar-actions .toolbar-button { display: none; }.inspector-panel { border-left: 0; border-top: 1px solid var(--line); max-height: none; }.viewport-panel { min-height: 460px; }.status-controls { overflow-x: auto; }.status-check { display: none; } }

/* Paired workflow: each left-hand task step stays beside the exact panel it controls. */
.workflow-pairs { display: grid; gap: 18px; }
.workflow-pair { display: grid; grid-template-columns: minmax(252px, 310px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.workflow-step, .workflow-panel { min-width: 0; padding: 20px; }
.workflow-step h2, .panel-heading h2, .preview-heading h2 { margin-bottom: 5px; }
.workflow-step { align-content: start; }
.step-copy { color: #66716d; font-size: 12px; line-height: 1.55; margin: -2px 0 13px; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.panel-heading p { color: #66716d; font-size: 12px; line-height: 1.55; }
.material-editor-grid { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(250px, 1.1fr); gap: 14px; align-items: start; }
#product-canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; background: #202a33; border: 1px solid #d7e2da; border-radius: 11px; cursor: crosshair; }
#product-canvas:focus-visible { outline: 3px solid rgba(217, 130, 37, .35); outline-offset: 3px; }
.material-region-list { max-height: 540px; overflow: auto; margin: 0; padding-right: 2px; }
.light-pane { display: grid; gap: 13px; align-content: start; }
.light-pane .studio-standard-card { grid-column: auto; }
.tuning-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; border: 1px solid #dfe8e2; border-radius: 12px; background: #fbfdfb; }
.tuning-grid .field { min-width: 0; margin: 0; font-size: 12px; }
.tuning-grid .field span { color: #637269; font-size: 11px; }
.camera-adjustment-controls { display: block; padding: 0; border: 1px solid #ead5b6; border-radius: 10px; background: #fffaf2; }
.camera-adjustment-controls summary { min-height: 44px; display: flex; align-items: center; padding: 10px 13px; cursor: pointer; color: #795022; font-weight: 700; font-size: 12px; }
.camera-adjustment-controls .advanced-tuning-grid { margin: 0 11px 11px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.render-workspace { margin: 0; padding: 20px; border-top: 0; }
.render-workspace .preview-heading { margin-bottom: 12px; }
.render-workspace .render-stage { min-height: 320px; padding: 10px; background: #f6f8f6; }
.render-workspace #fast-preview-canvas, .render-workspace #blender-preview, .render-workspace .render-placeholder { width: min(100%, 540px); max-height: 540px; }
.render-workspace .footnote { margin: 12px 0 0; }

@media (min-width: 1200px) {
  .workflow-pair { grid-template-columns: minmax(270px, 310px) minmax(0, 1fr); }
  .material-editor-grid { grid-template-columns: minmax(330px, .88fr) minmax(310px, 1.12fr); }
}

@media (max-width: 1100px) {
  .workflow-pair { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); gap: 14px; }
  .workflow-step, .workflow-panel { padding: 16px; }
  .tuning-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .material-editor-grid { grid-template-columns: minmax(230px, .88fr) minmax(230px, 1.12fr); }
}

@media (max-width: 850px) {
  .workflow-pair { grid-template-columns: 1fr; gap: 12px; }
  .workflow-step, .workflow-panel { padding: 15px; }
  .panel-heading { flex-direction: column; }
  .material-editor-grid, .tuning-grid, .camera-adjustment-controls .advanced-tuning-grid { grid-template-columns: 1fr; }
  .material-region-list { max-height: 340px; }
  .render-workspace .render-stage { min-height: 260px; grid-template-columns: 1fr; }
}

/* Keep the baseline import and product tree reachable in both workspaces. */
.desktop-shell.render-active { grid-template-columns: 260px minmax(0, 1fr) 320px; grid-template-areas: "top top top" "tree viewport inspector" "bottom bottom bottom"; }
@media (max-width: 1100px) {
  .desktop-shell, .desktop-shell.render-active { grid-template-columns: 185px minmax(0, 1fr) 280px; }
  .project-tree-panel { display: flex; flex-direction: column; min-width: 0; }
}
@media (max-width: 760px) {
  .desktop-shell, .desktop-shell.render-active { grid-template-columns: 160px minmax(300px, 1fr) 260px; overflow-x: auto; }
}


.project-tree-panel { flex-direction: column; }

.reset-adjustment{border:1px solid #c7cbc5;border-radius:4px;background:#fff;color:#505850;font:inherit;font-size:11px;padding:4px 6px;cursor:pointer}.inspector-heading{flex-wrap:wrap;gap:6px}.reset-adjustment:hover{border-color:var(--accent);color:var(--accent)}#export-three-views-button{width:100%;margin:8px 0;white-space:normal}

.material-color-row { gap: 8px; }
.material-color-row > label { margin-right: auto; white-space: nowrap; }
.material-color-row input[type="color"] { width: 38px; height: 28px; padding: 2px; border: 1px solid #c5ceca; background: #fff; cursor: pointer; flex: 0 0 38px; }
#material-color-hex { width: 82px; min-width: 0; padding: 5px; border: 1px solid #c5ceca; border-radius: 3px; background: #fff; font: inherit; }
#material-color-hex[aria-invalid="true"] { border-color: #bf3028; }
.material-color-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; }
.material-color-options button { width: 24px; height: 24px; min-height: 24px; padding: 0; border: 1px solid #aeb8b3; border-radius: 50%; background: var(--swatch); }
.material-color-options button[aria-pressed="true"] { outline: 2px solid #b92c25; outline-offset: 2px; }
.material-color-options button:disabled { opacity: .4; cursor: default; }
.material-color-feedback { margin: 0 0 8px; color: #65756e; font-size: 12px; line-height: 1.4; }

.epdm-palette-color { display:flex; align-items:center; gap:6px; font-size:12px; padding:3px 6px; border:1px solid #d4ddda; border-radius:3px; }
.epdm-palette-color input { width:32px; height:24px; padding:0; cursor:pointer; }
