:root {
  color-scheme: light;
  --color-bg: #f3f5f6;
  --color-surface: #ffffff;
  --color-surface-soft: #f8f9fa;
  --color-text: #172630;
  --color-text-muted: #495961;
  --color-text-faint: #56656d;
  --color-border: #e0e5e8;
  --color-border-strong: #cbd4d9;
  --color-accent: #b45324;
  --color-accent-soft: #fff0e5;
  --color-accent-ink: #713111;
  --color-good: #176847;
  --color-good-soft: #e6f5ed;
  --color-warning: #815514;
  --color-warning-soft: #fff2d9;
  --color-canvas: #14232c;
  --color-canvas-line: #30444d;
  --color-fuel: #f29a55;
  --color-gap: #dfe7e3;
  --color-clad: #60c2ca;
  --color-water: #557f9b;
  --radius-small: 8px;
  --radius-control: 10px;
  --radius-card: 14px;
  --radius-large: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; background: var(--color-bg); }
body { min-width: 0; min-height: 100vh; margin: 0; color: var(--color-text); background: var(--color-bg); font-size: 14px; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 3px solid #176a78; outline-offset: 2px; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 50; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-140%); color: white; background: #172630; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 16px 16px; background: #fafbfb; border-right: 1px solid var(--color-border); }
.brand { display: flex; gap: 11px; align-items: center; width: fit-content; margin: 0 0 28px 8px; color: var(--color-text); text-decoration: none; }
.brand-mark { width: 27px; height: 27px; position: relative; display: inline-block; }
.brand-mark i { position: absolute; inset: 1px; border: 2px solid #db7a37; border-radius: 50%; transform: rotate(-32deg) scaleX(.64); }
.brand-mark i:nth-child(2) { transform: rotate(32deg) scaleX(.64); border-color: #55aeb4; }
.brand-mark i:nth-child(3) { inset: 7px; border: 0; background: #d8844b; border-radius: 50%; }
.brand-name { font-size: 23px; line-height: 1; font-weight: 720; letter-spacing: -.065em; }
.degree { color: #b45324; font-size: 14px; vertical-align: top; margin-left: 1px; }
.sidebar-rule { height: 1px; background: var(--color-border); margin: 0 6px 22px; }
.nav-caption, .panel-kicker, .eyebrow, .dialog-eyebrow, .build-label { color: var(--color-text-faint); font-size: 12px; line-height: 1.3; font-weight: 700; letter-spacing: .105em; }
.nav-caption { margin: 0 10px 9px; }
.primary-nav { display: grid; gap: 5px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 12px; text-align: left; color: var(--color-text-muted); background: transparent; border: 0; border-radius: 10px; font-weight: 540; cursor: pointer; }
.nav-item:hover:not(:disabled) { color: var(--color-text); background: #f0f3f4; }
.nav-item.is-active { color: #7d3a19; background: #f7e9dc; font-weight: 650; }
.nav-item:disabled { opacity: .48; }
.nav-icon { width: 18px; font-size: 17px; text-align: center; }
.sidebar-bottom { display: grid; gap: 19px; margin-top: auto; }
.local-note { display: flex; gap: 9px; align-items: flex-start; padding: 12px 10px; background: #f0f4f3; border-radius: 10px; }
.local-dot, .save-dot, .status-dot, .dock-led { width: 7px; height: 7px; flex: 0 0 auto; display: inline-block; margin-top: 4px; border-radius: 50%; background: #27805d; }
.local-note strong, .local-note span { display: block; }
.local-note strong { font-size: 12px; font-weight: 650; }
.local-note div span { margin-top: 3px; color: var(--color-text-muted); font-size: 12px; }
.docs-link { display: flex; justify-content: space-between; padding: 0 10px; color: var(--color-text-muted); text-decoration: none; font-size: 12px; }
.docs-link:hover { color: var(--color-accent); }
.build-label { padding: 12px 10px 0; border-top: 1px solid var(--color-border); }
.build-label span { display: block; margin-top: 4px; color: var(--color-text-muted); font-size: 12px; font-weight: 550; letter-spacing: .06em; }

.app-column { min-width: 0; }
.topbar { position: sticky; z-index: 5; top: 0; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 28px; background: rgb(250 251 251 / 94%); border-bottom: 1px solid var(--color-border); backdrop-filter: blur(18px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.crumb-root { color: var(--color-text); font-weight: 650; }
.crumb-slash { color: #59676f; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.save-state { display: flex; align-items: center; gap: 7px; margin-right: 6px; color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.save-dot { width: 6px; height: 6px; margin: 0; }
.icon-button, .small-icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; color: #42545e; background: transparent; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 19px; }
.small-icon-button[aria-pressed="true"] { color: #713111; background: #f7e9dc; border-color: #e6c5ae; }
.icon-button:hover:not(:disabled), .small-icon-button:hover:not(:disabled) { background: #eef2f3; }
.icon-button:disabled { opacity: .35; }
.top-action, .quiet-button, .secondary-button, .primary-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 12px; font-weight: 630; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, scale 120ms ease; }
.top-action { color: #334851; background: transparent; border-color: var(--color-border); }
.top-action span { color: var(--color-text-faint); font-size: 12px; font-weight: 500; }
.top-action:hover { background: #f0f3f4; border-color: var(--color-border-strong); }
.primary-button { color: #fff; background: #a6491f; box-shadow: 0 1px 2px rgb(68 32 15 / 14%); }
.primary-button:hover:not(:disabled) { background: #8e3d19; }
.primary-button:active:not(:disabled), .secondary-button:active:not(:disabled), .top-action:active:not(:disabled) { scale: .96; transition-duration: 150ms; }
.primary-button:disabled { opacity: .55; }
.secondary-button { color: #273a43; background: #fff; border-color: #d5dde1; }
.secondary-button:hover { background: #f7f9f9; border-color: #aebbc1; }
.quiet-button { color: #52616a; background: transparent; }
.quiet-button:hover { background: #edf1f2; }
#main { min-height: calc(100vh - 64px); }
h1[tabindex="-1"]:focus-visible { outline: 3px solid #176a78; outline-offset: 4px; border-radius: 3px; }

.library-screen { max-width: 1510px; margin: 0 auto; padding: 28px 36px 38px; }
.welcome-row { min-height: 304px; display: grid; grid-template-columns: minmax(360px, 1.08fr) minmax(360px, .92fr); align-items: center; overflow: hidden; padding: 29px 34px 24px 36px; background: #e8edef; border: 1px solid #dce3e6; border-radius: 22px; }
.welcome-row h1 { margin: 17px 0 12px; font-size: clamp(34px, 3.45vw, 48px); line-height: 1.07; font-weight: 630; letter-spacing: -.04em; }
.welcome-row h1 span { color: #52616a; font-weight: 500; }
.welcome-copy { max-width: 490px; margin: 0; color: #52616a; font-size: 14px; line-height: 1.65; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.large-button { min-height: 42px; padding: 0 15px; font-size: 12px; }
.plus-mark { font-size: 17px; font-weight: 400; }
.hero-figure { min-width: 0; position: relative; align-self: stretch; display: grid; place-items: center; margin: -10px -20px -3px 0; overflow: hidden; }
.hero-figure::before { content: ""; position: absolute; width: 290px; height: 220px; top: 31px; right: 48px; border-radius: 50%; background: radial-gradient(ellipse, rgb(255 255 255 / 62%), rgb(255 255 255 / 0%) 68%); }
.hero-figure svg { position: relative; z-index: 1; width: min(100%, 470px); height: auto; overflow: visible; filter: drop-shadow(0 18px 22px rgb(28 45 54 / 10%)); }
.figure-caption { position: absolute; right: 26px; bottom: 9px; color: #596c74; font-size: 12px; }

.library-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 29px 0 16px; }
.library-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.library-heading p { margin: 5px 0 0; color: var(--color-text-muted); font-size: 12px; }
.library-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip { min-height: 31px; padding: 0 10px; color: #4e5d66; background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; }
.filter-chip:hover { background: #eaeeef; }
.filter-chip.is-selected { color: #6d371f; background: #fff; border-color: #dce2e5; box-shadow: 0 1px 2px rgb(35 51 58 / 5%); font-weight: 650; }
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.template-card { min-height: 196px; display: flex; flex-direction: column; padding: 16px 16px 14px; background: var(--color-surface); border: 1px solid #e1e6e8; border-radius: 14px; box-shadow: 0 1px 2px rgb(26 42 50 / 3%); }
.template-card:hover { border-color: #c9d2d6; box-shadow: 0 5px 15px rgb(31 48 56 / 7%); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-art { width: 39px; height: 39px; display: grid; place-items: center; color: var(--color-accent); background: #fff1e6; border-radius: 11px; font-size: 19px; }
.card-art.hex { color: #488c90; background: #e8f5f4; }
.card-art.benchmark { color: #526a8c; background: #edf1f8; }
.card-art.generic { color: #815d26; background: #faf1de; }
.status-pill { max-width: 70%; overflow: hidden; padding: 4px 7px; color: #596871; background: #f0f3f4; border-radius: 999px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill.editable { color: #245c46; background: #e8f4ed; }
.status-pill.reference { color: #65531e; background: #f8f1df; }
.template-card h3 { margin: 14px 0 5px; font-size: 13px; letter-spacing: -.01em; }
.template-card p { margin: 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.5; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 13px; color: #677780; font-size: 12px; }
.card-footer button { display: inline-flex; align-items: center; gap: 6px; padding: 0; color: #87441f; background: transparent; border: 0; cursor: pointer; font-size: 12px; font-weight: 650; }
.card-footer button:hover { color: #5d2d15; }
.library-footnote { display: flex; align-items: center; gap: 9px; margin-top: 15px; padding: 11px 13px; color: #5f6660; background: #f8f4ea; border: 1px solid #eee6d7; border-radius: 10px; font-size: 12px; }
.library-footnote > span { font-size: 14px; }
.library-footnote p { margin: 0; line-height: 1.5; }
.library-footnote a { flex: 0 0 auto; margin-left: auto; color: #75481b; font-size: 12px; text-decoration: none; }
.library-footnote a:hover { text-decoration: underline; }

.studio-screen { max-width: 1800px; margin: 0 auto; padding: 17px 22px 22px; }
.studio-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 2px 15px; }
.model-title-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.model-glyph { width: 34px; height: 34px; display: grid; place-items: center; color: #a94e24; background: #f8e9dc; border-radius: 11px; font-size: 17px; }
.model-title-group h1 { overflow: hidden; margin: 0; font-size: 15px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.model-title-group p { margin: 4px 0 0; color: var(--color-text-faint); font-size: 12px; }
.title-separator { padding: 0 6px; color: #59676f; }
.model-title-actions { display: flex; align-items: center; gap: 5px; }
.editor-grid { display: grid; grid-template-columns: minmax(210px, 248px) minmax(340px, 1fr) minmax(225px, 264px); gap: 10px; align-items: stretch; }
.inspector, .viewport-panel { min-width: 0; min-height: 545px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 1px 2px rgb(32 48 56 / 3%); }
.inspector { display: flex; flex-direction: column; overflow: hidden; }
.panel-heading { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; border-bottom: 1px solid #edf0f1; }
.panel-kicker { font-size: 12px; }
.panel-heading h2 { overflow: hidden; max-width: 185px; margin: 4px 0 0; font-size: 13px; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.small-icon-button { width: 30px; height: 30px; color: #53646d; font-size: 16px; }
.tree-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 39px; padding: 0 12px; color: #66767e; background: #fbfcfc; border-bottom: 1px solid #edf0f1; font-size: 12px; }
.tree-location code { margin-left: 4px; padding: 2px 4px; color: #52636c; background: #eef2f3; border-radius: 4px; font-size: 12px; }
.text-button { padding: 4px 6px; color: #8b461f; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 650; }
.text-button:hover { background: #fff1e7; }
.tree-list { display: grid; gap: 2px; padding: 8px 7px 12px; }
.tree-item { width: 100%; min-height: 33px; display: flex; align-items: center; gap: 7px; padding: 0 7px; color: #354851; background: transparent; border: 0; border-radius: 7px; text-align: left; cursor: pointer; font-size: 12px; }
.tree-item:hover { background: #f2f5f6; }
.tree-item.is-selected { color: #713b20; background: #fbefe5; font-weight: 650; }
.tree-item.group-label { padding: 2px 10px 0; color: var(--color-text-faint); cursor: default; font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.tree-item.level-1 { padding-left: 21px; }
.tree-item.level-2 { padding-left: 36px; }
.tree-chevron { width: 9px; color: #819099; font-size: 12px; }
.tree-symbol { width: 16px; text-align: center; color: #ad6a40; font-size: 12px; }
.tree-item[data-kind="surface"] .tree-symbol { color: #4f9295; }
.tree-item[data-kind="universe"] .tree-symbol { color: #6a78a2; }
.tree-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-id { margin-left: auto; color: var(--color-text-faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tree-vis { width: 19px; padding: 3px 0; color: #76858c; background: transparent; border: 0; cursor: pointer; font-size: 12px; }
.tree-vis[aria-pressed="false"] { opacity: .45; }
.tree-section { padding: 0 12px 10px; border-top: 1px solid #edf0f1; }
.tree-section-label { min-height: 38px; display: flex; align-items: center; justify-content: space-between; color: #566770; font-size: 12px; font-weight: 650; }
.material-list { display: grid; gap: 5px; }
.material-row { min-width: 0; display: flex; align-items: center; gap: 7px; color: #52636b; font-size: 12px; }
.material-swatch { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 3px; }
.material-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.occurrence-note { display: flex; gap: 8px; align-items: flex-start; margin: auto 9px 10px; padding: 9px; color: #64675f; background: #f7f3e9; border-radius: 8px; font-size: 12px; line-height: 1.45; }
.note-icon { color: #8f6425; font-size: 12px; }

.viewport-panel { display: flex; flex-direction: column; overflow: hidden; }
.viewport-toolbar { min-height: 53px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 0 13px; border-bottom: 1px solid #e6ebed; }
.view-tabs { display: flex; gap: 3px; padding: 3px; background: #f0f3f4; border-radius: 9px; }
.view-tab { min-width: 37px; min-height: 27px; padding: 0 8px; color: #596971; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.view-tab:hover { color: #273a43; }
.view-tab.is-active { color: #293a43; background: #fff; box-shadow: 0 1px 2px rgb(32 46 53 / 13%); }
.view-tools { display: flex; gap: 1px; }
.focus-path { min-width: 0; width: 100%; display: flex; align-items: center; gap: 7px; order: 3; overflow-x: auto; padding: 5px 1px 2px; border-top: 1px solid #edf0f1; white-space: nowrap; }
.path-step { min-height: 27px; flex: 0 0 auto; padding: 0 8px; color: #53656e; background: #f3f6f6; border: 1px solid #e2e8e9; border-radius: 7px; cursor: pointer; font-size: 12px; }
.path-step:hover { color: #713b20; background: #fbefe5; border-color: #e6c8b2; }
.path-step[aria-current="step"] { color: #713b20; background: #fff5eb; border-color: #e5c3aa; font-weight: 650; }
.path-separator { flex: 0 0 auto; color: #8c9ba0; font-size: 12px; }
.path-current { flex: 0 0 auto; color: #263b45; font-size: 12px; font-weight: 650; }
.path-hint { margin-left: auto; color: #64757c; font-size: 12px; }
.view-tools .small-icon-button[aria-pressed="true"] { color: #8e451f; background: #fff1e6; }
.canvas-wrap { position: relative; min-height: 410px; flex: 1 1 auto; overflow: hidden; background-color: var(--color-canvas); background-image: linear-gradient(rgb(72 98 109 / 11%) 1px, transparent 1px), linear-gradient(90deg, rgb(72 98 109 / 11%) 1px, transparent 1px); background-size: 28px 28px; }
#geometry-canvas { width: 100%; height: 100%; min-height: 410px; display: block; cursor: grab; touch-action: none; }
#geometry-canvas:active { cursor: grabbing; }
.canvas-overlay { position: absolute; z-index: 1; display: flex; align-items: center; gap: 8px; color: #b7c6cc; pointer-events: none; font-size: 12px; }
.canvas-overlay button { pointer-events: auto; }
.top-left { top: 14px; left: 15px; }
.top-right { top: 10px; right: 12px; }
.bottom-left { bottom: 13px; left: 14px; gap: 5px; }
.bottom-right { right: 12px; bottom: 9px; gap: 5px; }
.view-axis { color: #9cb1b9; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.model-bounds { margin-left: 3px; padding-left: 9px; color: #7e989f; border-left: 1px solid #42565f; font-variant-numeric: tabular-nums; }
.overlay-select { padding: 5px 7px; color: #c4d2d6; background: rgb(27 45 54 / 90%); border: 1px solid #41545b; border-radius: 6px; cursor: pointer; font-size: 12px; }
.legend-mark { width: 7px; height: 7px; margin-left: 5px; border-radius: 2px; }
.legend-mark:first-child { margin-left: 0; }
.legend-mark.fuel { background: var(--color-fuel); }
.legend-mark.gap { background: var(--color-gap); }
.legend-mark.clad { background: var(--color-clad); }
.legend-mark.water { background: var(--color-water); }
.canvas-separator { width: 1px; height: 12px; margin: 0 4px; background: #40545d; }
.bottom-right button { width: 17px; height: 19px; padding: 0; color: #c7d6db; background: transparent; border: 0; cursor: pointer; font-size: 13px; }
.bottom-right button:hover { color: #fff; }
.canvas-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #d8e2e5; background: rgb(20 35 44 / 86%); text-align: center; }
.canvas-empty strong { font-size: 14px; }
.canvas-empty span:not(.empty-symbol) { max-width: 240px; color: #aabac0; font-size: 12px; line-height: 1.5; }
.empty-symbol { color: #e7a36b; font-size: 27px; }
.canvas-empty button { margin-top: 6px; }
.viewport-footer { min-height: 33px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; color: #65747b; font-size: 12px; }
.viewport-footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; margin: 0; }
.renderer-note { color: #78868b; }

.properties-panel { min-height: 545px; }
.inspector-content { padding: 12px 13px 16px; }
.inspector-placeholder { min-height: 150px; display: grid; place-items: center; align-content: center; gap: 9px; color: #59676e; text-align: center; }
.placeholder-ring { width: 37px; height: 37px; display: grid; place-items: center; color: #5d7077; background: #f0f4f5; border-radius: 50%; font-size: 18px; }
.inspector-placeholder p { max-width: 185px; margin: 0; font-size: 12px; line-height: 1.55; }
.property-block { padding-bottom: 13px; border-bottom: 1px solid #edf0f1; }
.property-block + .property-block { padding-top: 13px; }
.property-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; color: #566771; font-size: 12px; font-weight: 650; }
.property-label small { color: var(--color-text-faint); font-size: 12px; font-weight: 500; }
.property-field { min-height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 9px; background: #fafbfb; border: 1px solid #dce3e6; border-radius: 8px; }
.property-field:focus-within { border-color: #5f9297; box-shadow: 0 0 0 2px rgb(84 147 152 / 15%); }
.property-field input, .property-field select { width: 100%; min-width: 0; padding: 0; color: #253740; background: transparent; border: 0; outline: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.property-field input:focus-visible, .property-field select:focus-visible { outline: none; }
.property-field .unit { flex: 0 0 auto; color: #73818a; font-size: 12px; }
.dimension-list { display: grid; gap: 9px; }
.dimension-control { display: grid; gap: 5px; }
.dimension-control label { display: flex; justify-content: space-between; color: #53656e; font-size: 12px; }
.dimension-control output { color: #293d46; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.dimension-control input[type="range"] { width: 100%; height: 4px; accent-color: #ad5427; cursor: ew-resize; }
.dimension-control input[type="range"]:focus-visible { outline-offset: 5px; }
.unit-switch { display: inline-flex; gap: 2px; padding: 2px; background: #edf1f2; border-radius: 7px; }
.unit-switch button { min-width: 27px; min-height: 21px; padding: 0 5px; color: #5f6d74; background: transparent; border: 0; border-radius: 5px; cursor: pointer; font-size: 12px; }
.unit-switch button.is-active { color: #253740; background: #fff; box-shadow: 0 1px 2px rgb(35 51 58 / 14%); }
.boolean-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.boolean-tools button { min-height: 31px; padding: 0 4px; color: #4d5f68; background: #f7f9f9; border: 1px solid #e0e6e8; border-radius: 7px; cursor: pointer; font-size: 12px; }
.boolean-tools button:hover { color: #773f20; background: #fff4eb; border-color: #edc9ad; }
.formula { overflow-wrap: anywhere; padding: 9px; color: #405660; background: #f4f7f7; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55; }
.shared-edit { display: grid; gap: 7px; }
.shared-edit label { display: flex; gap: 7px; align-items: center; color: #53656d; font-size: 12px; cursor: pointer; }
.shared-edit input { accent-color: #a94e24; }
.metadata-note { margin-top: 9px; padding: 8px; color: #626c69; background: #f6f4ef; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.delete-item { width: 100%; min-height: 32px; margin-top: 12px; color: #963d32; background: #fff; border: 1px solid #ead8d5; border-radius: 8px; cursor: pointer; font-size: 12px; }
.delete-item:hover { background: #fff4f2; }

.bottom-dock { margin-top: 10px; overflow: hidden; background: #fff; border: 1px solid var(--color-border); border-radius: 12px; }
.dock-title { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 13px; color: #64737a; border-bottom: 1px solid #edf0f1; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.dock-led { width: 6px; height: 6px; margin: 0; background: #58928d; }
.dock-title span:last-child { margin-left: auto; color: var(--color-text-faint); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.dock-content { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 11px; color: #68777e; font-size: 12px; }
.dock-content.is-error { color: #8d3c30; background: #fff6f4; }
.dock-content.is-ok { color: #266347; background: #f3faf6; }

.sheet-dialog { width: min(460px, calc(100vw - 28px)); max-height: min(680px, calc(100vh - 30px)); padding: 25px; color: var(--color-text); background: #fff; border: 1px solid #dce3e6; border-radius: 18px; box-shadow: 0 20px 60px rgb(19 34 42 / 23%); }
.sheet-dialog::backdrop { background: rgb(15 27 34 / 38%); backdrop-filter: blur(3px); }
.sheet-dialog form { position: absolute; top: 13px; right: 13px; }
.dialog-close { width: 31px; height: 31px; color: #596a72; background: #f1f4f5; border: 0; border-radius: 50%; cursor: pointer; font-size: 19px; line-height: 1; }
.sheet-dialog h2 { margin: 8px 34px 8px 0; font-size: 21px; line-height: 1.2; letter-spacing: -.035em; }
.sheet-dialog > p, #notes-content { color: #596a72; font-size: 12px; line-height: 1.6; }
.export-options { display: grid; gap: 7px; margin-top: 17px; }
.export-option { min-height: 59px; display: grid; grid-template-columns: 35px minmax(0,1fr) 18px; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid #e0e6e8; border-radius: 10px; text-align: left; cursor: pointer; }
.export-option:hover { background: #fafbfb; border-color: #c5d0d5; }
.file-type { width: 33px; height: 33px; display: grid; place-items: center; color: #4a7481; background: #eaf2f5; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 12px; font-weight: 700; }
.file-type.py { color: #795f28; background: #f6f0df; }
.file-type.json { color: #644f87; background: #f0ebf7; }
.export-option strong, .export-option small { display: block; }
.export-option strong { font-size: 12px; }
.export-option small { margin-top: 4px; color: #59676e; font-size: 12px; }
.export-option > span:last-child { color: #77868d; font-size: 15px; }
.export-foot { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding-top: 12px; color: #60716f; border-top: 1px solid #edf0f1; font-size: 12px; }
.local-lock { color: #287054; font-size: 14px; }
.notes-dialog #notes-content { margin-top: 14px; padding: 12px; background: #f6f8f8; border-radius: 9px; }
.notes-dialog #notes-content p { margin: 0 0 9px; }
.notes-dialog #notes-content p:last-child { margin-bottom: 0; }
.dialog-done { width: 100%; margin-top: 13px; }
.primitive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.primitive-card { min-height: 96px; display: grid; align-content: center; justify-items: start; gap: 5px; padding: 10px; background: #fff; border: 1px solid #e1e6e8; border-radius: 10px; text-align: left; cursor: pointer; }
.primitive-card:hover { background: #fbf5ef; border-color: #e4c0a5; }
.primitive-card > span { color: #a24c23; font-size: 18px; }
.primitive-card strong { font-size: 12px; }
.primitive-card small { color: #65747b; font-size: 12px; }
.dialog-hint { margin: 13px 0 0; padding: 9px; color: #6b6c61 !important; background: #f8f5eb; border-radius: 8px; font-size: 12px !important; }
.toast { position: fixed; z-index: 20; right: 20px; bottom: 20px; max-width: min(390px, calc(100vw - 32px)); padding: 11px 14px; color: #fff; background: #20343c; border: 1px solid #354d56; border-radius: 10px; box-shadow: 0 8px 28px rgb(17 31 38 / 25%); font-size: 12px; line-height: 1.45; }

.docs-body { background: #f3f5f6; }
.docs-page { width: min(760px, calc(100% - 36px)); margin: 0 auto; padding: 40px 0 72px; color: var(--color-text); font-size: 16px; line-height: 1.65; }
.docs-page > a:first-child { display: inline-block; margin-bottom: 34px; color: var(--color-accent-ink); font-size: 14px; text-decoration-thickness: from-font; text-underline-offset: .18em; }
.docs-page .eyebrow { margin-bottom: 12px; color: var(--color-text-faint); }
.docs-page h1 { margin: 0 0 14px; font-size: clamp(34px, 6vw, 48px); line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
.docs-page h2 { margin: 34px 0 8px; font-size: 22px; line-height: 1.25; letter-spacing: -.02em; }
.docs-page p, .docs-page li { max-width: 72ch; color: var(--color-text-muted); }
.docs-page li + li { margin-top: 5px; }
.docs-page a { color: var(--color-accent-ink); }
.docs-page code { overflow-wrap: anywhere; padding: 2px 5px; color: #263a43; background: #e8edef; border-radius: 4px; font-size: .88em; }
.docs-page:focus-visible { outline: 3px solid #176a78; outline-offset: 5px; }

@media (max-width: 1240px) {
  .editor-grid { grid-template-columns: minmax(205px, 235px) minmax(310px, 1fr); }
  .properties-panel { grid-column: 1 / -1; min-height: 0; }
  .properties-panel .inspector-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
  .properties-panel .property-block, .properties-panel .property-block + .property-block { padding: 0 10px 10px; border: 0; border-right: 1px solid #edf0f1; }
  .properties-panel .property-block:last-child { border: 0; }
  .properties-panel .metadata-note { margin-top: 0; }
  .inspector-placeholder { min-height: 85px; }
  .library-screen { padding: 24px 25px 32px; }
  .template-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 840px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-width: 0; position: sticky; z-index: 8; top: 0; min-height: 0; display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .brand { flex: 0 0 auto; margin: 0; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: 20px; }
  .sidebar-rule, .nav-caption, .sidebar-bottom { display: none; }
  .primary-nav { min-width: 0; display: flex; gap: 3px; overflow-x: auto; }
  .nav-item { min-height: 36px; gap: 7px; padding: 0 10px; white-space: nowrap; font-size: 12px; }
  .nav-icon { width: auto; font-size: 14px; }
  .topbar { position: relative; min-height: 54px; padding: 0 16px; }
  .library-screen { padding: 18px 17px 26px; }
  .welcome-row { grid-template-columns: minmax(0,1fr) minmax(230px,.85fr); padding: 25px 22px; }
  .welcome-row h1 { font-size: clamp(30px, 5vw, 40px); }
  .hero-figure { margin-right: -22px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .studio-screen { padding: 12px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .tree-panel { min-height: 0; }
  .tree-list { max-height: 220px; overflow-y: auto; }
  .occurrence-note { margin-top: 4px; }
  .viewport-panel { min-height: 520px; grid-row: 1; }
  .canvas-wrap { min-height: 430px; }
  #geometry-canvas { min-height: 430px; }
  .tree-panel { grid-row: 2; }
  .properties-panel { grid-row: 3; }
  .properties-panel .inspector-content { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dock-content { min-height: 42px; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 0; padding: 10px 13px; }
  .topbar-actions { width: 100%; justify-content: flex-end; gap: 5px; }
  .save-state { margin-right: auto; font-size: 12px; }
  .top-action { min-height: 32px; padding: 0 8px; font-size: 12px; }
  .top-action span { display: none; }
  .primary-button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .welcome-row { grid-template-columns: 1fr; padding: 23px 19px 10px; }
  .welcome-row h1 { margin-top: 13px; font-size: 35px; }
  .welcome-copy { max-width: none; font-size: 12px; }
  .welcome-actions { margin-top: 16px; }
  .hero-figure { min-height: 185px; max-height: 210px; margin: 3px -10px 0; }
  .hero-figure svg { max-width: 350px; max-height: 202px; }
  .hero-figure::before { width: 220px; height: 160px; top: 8px; right: calc(50% - 120px); }
  .label-top { top: 8px; right: 15px; }
  .label-bottom { bottom: 4px; left: 0; }
  .figure-caption { right: 7px; bottom: 3px; }
  .library-heading { align-items: flex-start; flex-direction: column; margin-top: 23px; }
  .library-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .filter-chip { flex: 0 0 auto; }
  .template-grid { grid-template-columns: 1fr; gap: 8px; }
  .template-card { min-height: 163px; }
  .library-footnote { align-items: flex-start; flex-wrap: wrap; font-size: 12px; }
  .library-footnote p { flex: 1 1 calc(100% - 30px); }
  .library-footnote a { margin: 0 0 0 25px; }
  .studio-screen { padding: 10px; }
  .studio-titlebar { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 10px; }
  .model-title-actions { width: 100%; justify-content: space-between; }
  .model-title-actions .primary-button { min-height: 34px; }
  .viewport-panel { min-height: 445px; }
  .viewport-toolbar { min-height: 47px; padding: 0 8px; }
  .view-tab { min-width: 32px; padding: 0 5px; }
  .view-tools .small-icon-button { width: 27px; }
  .canvas-wrap, #geometry-canvas { min-height: 350px; }
  .bottom-left { gap: 4px; left: 7px; font-size: 12px; }
  .bottom-left .legend-mark { width: 6px; height: 6px; margin-left: 2px; }
  .top-left { top: 10px; left: 9px; }
  .bottom-right { right: 5px; bottom: 7px; font-size: 12px; }
  .renderer-note { display: none; }
  .properties-panel .inspector-content { grid-template-columns: 1fr; gap: 0; }
  .properties-panel .property-block, .properties-panel .property-block + .property-block { padding: 12px 2px; border: 0; border-bottom: 1px solid #edf0f1; }
  .properties-panel .property-block:last-child { border: 0; }
  .dock-content { align-items: flex-start; flex-direction: column; gap: 3px; padding: 9px 11px; }
  .dock-title { font-size: 12px; }
  .sheet-dialog { padding: 22px 18px 18px; }
  .property-field input, .property-field select { min-height: 32px; font-size: 16px; }
}
@media (max-width: 350px) {
  .sidebar { gap: 8px; padding-right: 8px; padding-left: 9px; }
  .brand { gap: 6px; }
  .nav-item { padding: 0 7px; font-size: 12px; }
  .save-state > span:last-child { display: none; }
  .welcome-row h1 { font-size: 31px; }
  .model-bounds { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
