﻿:root {
  --chrome-top: #d8dce2;
  --chrome-bottom: #b7bec8;
  --chrome-line: #98a1ac;
  --panel-bg: #eff2f6;
  --panel-border: #a1abb9;
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --ink: #222933;
  --muted: #5d6672;
  --accent: #f3b24c;
  --accent-border: #9e6a1c;
  --blue: #5f8fe8;
  --toolbar-gap: 12px;
  --toolbar-square: 31px;
  --grid-dark: rgba(255, 255, 255, 0.085);
  --grid-dark-strong: rgba(255, 255, 255, 0.12);
  --grid-light: rgba(32, 49, 79, 0.07);
  --grid-light-strong: rgba(32, 49, 79, 0.12);
  --workbench-sidebar-width: 320px;
  --workbench-properties-width: 320px;
  --workbench-resizer-width: 6px;
  --projection-crosshair-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='65' height='65' viewBox='0 0 65 65'%3E%3Cpath d='M32.5 1v23M32.5 41v23M1 32.5h23M41 32.5h23' stroke='%23000000' stroke-width='3' stroke-linecap='square'/%3E%3Cpath d='M32.5 1v23M32.5 41v23M1 32.5h23M41 32.5h23' stroke='%23ffffff' stroke-width='1' stroke-linecap='square'/%3E%3Ccircle cx='32.5' cy='32.5' r='4' fill='none' stroke='%23000000' stroke-width='3'/%3E%3Ccircle cx='32.5' cy='32.5' r='4' fill='none' stroke='%23ffffff' stroke-width='1'/%3E%3C/svg%3E") 32 32, crosshair;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #c8ced7, #b2b9c3);
}

button,
input,
select {
  font: inherit;
}

.desktop-shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.app-chrome {
  border-bottom: 1px solid var(--chrome-line);
  background: linear-gradient(180deg, var(--chrome-top), var(--chrome-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.menu-strip,
.toolbar-strip {
  display: flex;
  align-items: center;
  gap: var(--toolbar-gap);
  padding: 4px 10px;
}

.menu-strip {
  min-height: 28px;
  border-bottom: 1px solid rgba(152, 161, 172, 0.55);
  font-size: 13px;
  position: relative;
  overflow: visible;
}

.menu-strip span {
  cursor: default;
}

.menu-status-group {
  margin-left: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}

.open-cascade-progress {
  min-width: 240px;
  max-width: 620px;
  height: 22px;
  margin-left: 4px;
  padding: 2px 8px;
  display: inline-flex;
  flex: 1 1 420px;
  align-items: center;
  gap: 9px;
  border: 1px solid #8d98a5;
  border-radius: 3px;
  background: linear-gradient(180deg, #f5f7fa, #d7dde6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.open-cascade-progress[hidden] {
  display: none;
}

.open-cascade-progress__label {
  min-width: 108px;
  color: #304051;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.open-cascade-progress__track {
  min-width: 80px;
  height: 12px;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid #7f8a96;
  border-radius: 7px;
  background: #eef1f5;
  box-shadow: inset 0 1px 2px rgba(35, 45, 57, 0.24);
}

.open-cascade-progress__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #35bb48, #078b1c);
  transition: width 160ms ease-out;
}

.open-cascade-progress.is-complete .open-cascade-progress__fill {
  background: linear-gradient(180deg, #2fc343, #078419);
}

.open-cascade-progress.has-errors {
  border-color: #ad6666;
}

.open-cascade-progress.has-errors .open-cascade-progress__label {
  color: #8f2020;
}

.open-cascade-progress.has-errors .open-cascade-progress__fill {
  background: linear-gradient(180deg, #dc6a55, #b83227);
}

.menu-strip:has(.open-cascade-progress:not([hidden])) .status-pill {
  min-width: 160px;
  max-width: 260px;
}

.menu-root {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.menu-root-button {
  min-width: 0;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: default;
}

.menu-root-button:hover,
.menu-root-button:focus-visible,
.menu-root--open .menu-root-button {
  border-color: #8d98a5;
  border-bottom-color: #f7f8fa;
  background: linear-gradient(180deg, #fbfcfe, #edf1f6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  outline: none;
}

.menu-popup {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  min-width: 212px;
  padding: 2px;
  border: 1px solid #7f8a96;
  background: #f7f8fa;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.95),
    inset -1px -1px 0 rgba(166, 174, 183, 0.85);
  z-index: 30;
}

.menu-popup-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 3px 28px 3px 24px;
  border: 1px solid transparent;
  background: transparent;
  color: #1f2730;
  text-align: left;
  cursor: default;
}

.menu-popup-item[aria-pressed="true"]::before {
  position: absolute;
  left: 7px;
  content: "✓";
  color: #1f5f2f;
  font-weight: 700;
}

.menu-popup-item:hover,
.menu-popup-item:focus-visible {
  border-color: #2d5f9b;
  background: linear-gradient(180deg, #d9eaff, #b8d4f7);
  outline: none;
}

.toolbar-strip {
  min-height: 44px;
}

.tool-button {
  min-width: 88px;
  height: 30px;
  border: 1px solid #8d98a5;
  border-radius: 3px;
  background: linear-gradient(180deg, #fefefe, #d8dde6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #1f2730;
  cursor: pointer;
}

.tool-button:hover {
  background: linear-gradient(180deg, #fff7d9, #edd18a);
}

.tool-button:disabled {
  cursor: default;
  color: #7e8792;
  background: linear-gradient(180deg, #eceff4, #d1d7e0);
  box-shadow: none;
}

.tool-button.active-tool {
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
  border-color: var(--accent-border);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.primary-tool {
  font-weight: 700;
}

.toolbar-icon-button {
  min-width: var(--toolbar-square);
  width: var(--toolbar-square);
  height: var(--toolbar-square);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  border-color: #8f99a6;
  background: linear-gradient(180deg, #ffffff, #eef1f5);
  color: #2f3b4a;
}

.toolbar-icon-button:hover,
.toolbar-icon-button:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
  outline: none;
}

.toolbar-icon-button:active {
  background: linear-gradient(180deg, #f4d27c, #dea33a);
}

.toolbar-icon-button:disabled {
  border-color: #b4bcc7;
  background: linear-gradient(180deg, #f0f2f6, #d5dbe4);
  color: #93a0af;
}

.toolbar-icon-button__icon {
  width: var(--toolbar-square);
  height: var(--toolbar-square);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene-mode-icon,
.scene-view-icon {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.ui-icon__face {
  stroke: #263647;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon__outline,
.ui-icon__wire {
  fill: none;
  stroke: #223142;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon__outline--strong {
  stroke-width: 1.75;
}

.ui-icon__wire {
  stroke-width: 1.3;
}

.ui-icon__wood-top {
  fill: #d9b06f;
}

.ui-icon__wood-front {
  fill: #b88342;
}

.ui-icon__wood-side {
  fill: #916332;
}

.ui-icon__grain {
  fill: none;
  stroke: rgba(78, 48, 24, 0.62);
  stroke-width: 0.85;
  stroke-linecap: round;
}

.ui-icon__muted-face {
  fill: #dce4ed;
}

.ui-icon__muted-face-alt {
  fill: #c1ccd9;
}

.ui-icon__selected {
  fill: #65aee9;
}

.ui-icon__selected-soft {
  fill: #9ecdf0;
}

.ui-icon__selected-alt {
  fill: #4b86c2;
}

.ui-icon__view-mark {
  fill: none;
  stroke: #164d86;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-toolbar-button.is-active .ui-icon__selected {
  fill: #f2b23d;
}

.scene-toolbar-button.is-active .ui-icon__selected-soft {
  fill: #ffd57d;
}

.scene-toolbar-button.is-active .ui-icon__selected-alt {
  fill: #d78a17;
}

.toolbar-icon-button:disabled .toolbar-icon-button__icon {
  opacity: 0.7;
}

.toolbar-icon-button[hidden] {
  display: none !important;
}

.toolbar-square-gap {
  flex: 0 0 calc(var(--toolbar-square) - (var(--toolbar-gap) * 2));
  width: calc(var(--toolbar-square) - (var(--toolbar-gap) * 2));
  height: var(--toolbar-square);
  pointer-events: none;
}

.toolbar-scene-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.toolbar-scene-controls[hidden] {
  display: none !important;
}

.line-tool {
  position: relative;
  padding-left: 34px;
}

.line-tool::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 2px;
  background: #0b46c9;
  transform: translateY(-50%) rotate(-35deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.status-pill {
  min-height: 30px;
  min-width: 220px;
  padding: 6px 12px;
  border: 1px solid #8d98a5;
  border-radius: 3px;
  background: linear-gradient(180deg, #fefefe, #d7dce5);
  color: var(--muted);
}

.menu-strip .status-pill {
  min-width: min(420px, 34vw);
  max-width: min(540px, 42vw);
  min-height: 22px;
  padding: 2px 12px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill--flash {
  animation: status-pill-flash 2s ease-in-out infinite;
}

.snap-owner-highlight {
  animation: snap-owner-highlight-blink var(--snap-blink-duration, 1s) ease-in-out infinite;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes status-pill-flash {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(0.9);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes snap-owner-highlight-blink {
  0% {
    opacity: 0.18;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.18;
  }
}

.workbench {
  min-height: 0;
  display: grid;
  grid-template-columns:
    42px
    var(--workbench-sidebar-width)
    var(--workbench-resizer-width)
    minmax(0, 1fr)
    var(--workbench-resizer-width)
    var(--workbench-properties-width);
  overflow: hidden;
}

.left-rail,
.sidebar,
.properties-panel {
  background: linear-gradient(180deg, #eef1f5, #dae0e8);
}

.left-rail {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 7px;
  border-right: 1px solid var(--panel-border);
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 5px;
}

.rail-separator {
  width: 31px;
  height: 1px;
  margin: 2px 0;
  border-top: 1px solid rgba(132, 144, 160, 0.7);
}

.rail-icon {
  width: 31px;
  height: 31px;
  border: 1px solid #8f99a6;
  background: linear-gradient(180deg, #fafbfd, #d5dce5);
}

.rail-icon.active {
  background: linear-gradient(180deg, #d9ebff, #8fc2ff);
}

.rail-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  cursor: pointer;
  border-color: #8f99a6;
  background: linear-gradient(180deg, #ffffff, #e7ebf1);
  color: #2d3f57;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.rail-action-button.active {
  background: linear-gradient(180deg, #ffffff, #e7ebf1);
}

.rail-action-button:hover {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
}

.rail-action-button:focus-visible {
  outline: 1px solid #234f94;
  outline-offset: 1px;
}

.rail-action-button--open {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
}

.rail-action-button.edge-command-button.is-active {
  border-color: #7b5822;
  background: linear-gradient(180deg, #ffe6a7, #efb84b);
}

.action-icon {
  display: block;
  width: 30px;
  height: 30px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.action-icon__surface {
  fill: rgba(120, 152, 197, 0.18);
  stroke: #58769e;
  stroke-width: 1.7;
}

.action-icon__outline {
  stroke: #4f6c92;
  stroke-width: 1.9;
}

.action-icon__accent {
  stroke: #c97812;
  stroke-width: 2.1;
}

.action-icon__accent-surface {
  fill: rgba(238, 189, 87, 0.22);
  stroke: #c97812;
  stroke-width: 1.85;
}

.action-icon__edge {
  stroke: #2d8f6f;
  stroke-width: 1.9;
}

.rail-action-button__icon {
  width: 30px;
  height: 30px;
}

.ui-icon__slab-top {
  fill: #e7b866;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__slab-side {
  fill: #b97c34;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__slab-edge {
  fill: #815225;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__panel-front {
  fill: #80b8e3;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__panel-front--warm {
  fill: #d9a76b;
}

.ui-icon__panel-side {
  fill: #4e78a4;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__panel-top {
  fill: #c8e1f4;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__plus,
.ui-icon__replace {
  fill: none;
  stroke: #15923b;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-icon__remove {
  fill: none;
  stroke: #d12d2d;
  stroke-width: 2.25;
  stroke-linecap: round;
}

.ui-icon__swatch {
  stroke: #263647;
  stroke-width: 1.15;
}

.ui-icon__swatch--back {
  fill: #6fafe3;
}

.ui-icon__swatch--front {
  fill: #d6a25e;
}

.ui-icon__edge-blue {
  fill: #506fe3;
  stroke: #223142;
  stroke-width: 1.05;
}

.ui-icon__edge-sample {
  fill: none;
  stroke: #526678;
  stroke-width: 1;
  stroke-linecap: round;
}

.ui-icon__edge-panel {
  fill: #d3a365;
  stroke: #263647;
  stroke-width: 1.1;
}

.ui-icon__edge-band {
  stroke-width: 0.9;
}

.rail-action-button__badge {
  position: absolute;
  right: 1px;
  bottom: 1px;
  min-width: 15px;
  padding: 0 2px;
  border: 1px solid rgba(101, 114, 133, 0.85);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(227, 232, 239, 0.96));
  color: #2d3f57;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.parts-create-inline-button {
  margin-top: 1px;
  margin-bottom: 1px;
  position: relative;
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  min-height: 31px;
  color: #111111;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.parts-create-inline-button:hover .parts-create-inline-icon {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
}

.parts-create-inline-button:focus-visible {
  outline: 1px solid #234f94;
  outline-offset: 2px;
}

.parts-create-inline-icon {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border: 1px solid #8f99a6;
  background: linear-gradient(180deg, #ffffff, #e7ebf1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  position: relative;
  color: #2d3f57;
}

.parts-create-inline-icon__svg {
  width: 34px;
  height: 34px;
}

.parts-create-inline-label {
  position: absolute;
  left: calc(50% + 25px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.sidebar,
.properties-panel {
  min-height: 0;
  min-width: 0;
  padding: 10px;
}

.sidebar {
  display: flex;
  overflow: hidden;
  padding: 0;
}

.properties-panel {
  overflow: auto;
}

.workbench-resizer {
  position: relative;
  min-height: 0;
  cursor: col-resize;
  background: linear-gradient(180deg, #eef2f6, #d2d8e1);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  border-right: 1px solid rgba(127, 138, 150, 0.9);
}

.workbench-resizer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-left: 1px solid rgba(255, 255, 255, 0.9);
  border-right: 1px solid rgba(123, 132, 144, 0.9);
}

.workbench-resizer:hover,
.workbench-resizer.is-dragging {
  background: linear-gradient(180deg, #fff2c6, #efbe56);
}

body.is-workbench-resizing,
body.is-workbench-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: linear-gradient(180deg, #cdd4de, #bcc3ce);
}

.editor-toolbar,
.panel,
.canvas-card {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 10px 0;
  padding: 8px 12px;
}

.scene-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  background: linear-gradient(180deg, #f3f6fb, #e2e8f1);
  box-shadow: none;
}

.scene-viewbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.scene-displaybar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
  padding-right: 10px;
  border-right: 1px solid rgba(141, 152, 165, 0.65);
}

.scene-view-button {
  min-width: var(--toolbar-square);
  width: var(--toolbar-square);
  height: var(--toolbar-square);
  padding: 0;
}

.scene-toolbar-button {
  position: relative;
  color: #2f3b4a;
}

.scene-toolbar-button:hover,
.scene-toolbar-button:focus-visible {
  color: #2b3541;
}

.scene-toolbar-button.is-active {
  border-color: #7b5822;
  background: linear-gradient(180deg, #ffe6a7, #efb84b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.scene-toolbar-button:disabled {
  color: #7e8792;
}

.scene-toolbar-button__surface {
  fill: currentColor;
  fill-opacity: 0.14;
  stroke: currentColor;
}

.scene-toolbar-button__view-face {
  fill: #4b62aa;
  fill-opacity: 0.78;
}

.scene-toolbar-button__secondary {
  opacity: 0.72;
}

.scene-toolbar-button__ghost {
  opacity: 0.42;
}

.scene-toolbar-button__accent {
  stroke: #c97812;
}


.editor-actions {
  display: flex;
  gap: 8px;
}
.toolbar-hint {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.panel {
  margin-bottom: 10px;
  padding: 10px;
}

.panel.compact {
  padding: 10px;
}

.sidebar .panel.compact {
  padding-bottom: 0;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
}

.lead,
.selection-editor.empty,
.part-meta,
.meta-key {
  color: var(--muted);
}

.badge {
  min-width: 28px;
  padding: 2px 8px;
  border: 1px solid #9f8f66;
  background: linear-gradient(180deg, #fff6dc, #efd38b);
  text-align: center;
}

.parts-list,
.selection-editor {
  display: grid;
  gap: 10px;
}

.parts-list {
  margin-top: 10px;
  gap: 0;
  align-content: start;
}

.structure-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  margin-bottom: 0;
  border: 0;
  box-shadow: none;
  padding: 0 !important;
}

.structure-panel > .properties-header {
  height: 23px;
  margin: 0;
  padding: 3px 7px;
  font-size: 12px;
  line-height: 16px;
}

.structure-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 90px;
  gap: 0;
  margin-top: 0;
  padding: 4px 8px;
  border: 1px solid #c1c9d4;
  border-bottom: 0;
  background: linear-gradient(180deg, #fdfefe, #e8edf4);
  color: #596270;
  font-size: 11px;
  font-weight: 700;
}

.structure-columns__position,
.structure-columns__designation {
  text-align: center;
}

.structure-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #8a98ab #e4e9f0;
  border: 1px solid #c1c9d4;
  border-top: 0;
  background: #fbfcfe;
}

.structure-list::-webkit-scrollbar {
  width: 12px;
}

.structure-list::-webkit-scrollbar-track {
  border-left: 1px solid #c9d1db;
  background: linear-gradient(180deg, #f2f5f9, #e2e8f0);
}

.structure-list::-webkit-scrollbar-thumb {
  border: 1px solid #7d8ca0;
  border-radius: 999px;
  background: linear-gradient(180deg, #c5d0dd, #9aa9bc);
}

.structure-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #b7c4d4, #8898ad);
}

.structure-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 52px 90px;
  align-items: center;
  min-height: 22px;
  border: 0;
  border-bottom: 1px solid #d9e0e8;
  background: linear-gradient(180deg, #ffffff, #f1f4f8);
  padding: 0;
  color: inherit;
  text-align: left;
  position: relative;
}

.structure-row:last-child {
  border-bottom: 0;
}

.structure-row--root {
  background: linear-gradient(180deg, #eef3fa, #dfe7f2);
  font-weight: 700;
}

.structure-row--group {
  background: linear-gradient(180deg, #f5f8fc, #e6ecf4);
  font-weight: 600;
}

.structure-row--object {
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
}

.structure-row--object[aria-selected],
.structure-row--group[aria-selected] {
  cursor: pointer;
}

.structure-row--object[aria-selected]:hover,
.structure-row--group[aria-selected]:hover {
  background: linear-gradient(180deg, #fff8e3, #f3e2af);
}

button.structure-row {
  width: 100%;
  cursor: pointer;
}

button.structure-row:hover {
  background: linear-gradient(180deg, #fff8e3, #f3e2af);
}

.structure-row--part {
  width: 100%;
  cursor: pointer;
}

.structure-row--part:hover {
  background: linear-gradient(180deg, #fff8e3, #f3e2af);
}

button.structure-row:focus-visible,
.structure-row[aria-selected]:focus-visible,
.structure-expander:focus-visible {
  outline: 1px solid #234f94;
  outline-offset: -1px;
}

.structure-row.is-selected {
  background: linear-gradient(180deg, #fff0c8, #e7ca83);
}

.structure-row.is-primary {
  background: linear-gradient(180deg, #fff0c8, #e7ca83);
}

.structure-row--part.is-selected {
  background: linear-gradient(180deg, #ffe8a8, #e4b64d);
  box-shadow: inset 3px 0 #a96b08;
}

.structure-row--part.is-primary {
  background: linear-gradient(180deg, #ffe39a, #dca83c);
}

.structure-row.is-multi-primary::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px dashed #85561a;
  pointer-events: none;
}

.structure-expander {
  width: 18px;
  height: 18px;
  margin: 0 2px;
  border: 1px solid #8f99a6;
  background: linear-gradient(180deg, #ffffff, #e7ebf1);
  color: #2d3f57;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.structure-expander-spacer {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 2px;
}

.structure-tree-cell {
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 22px;
}

.structure-tree-cell--root {
  padding-left: 0;
}

.structure-tree-branches {
  display: flex;
  align-self: stretch;
}

.structure-tree-branch {
  position: relative;
  display: block;
  flex: 0 0 14px;
  width: 14px;
  min-height: 22px;
}

.structure-tree-branch.is-continuing::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  border-left: 1px solid #aeb9c7;
}

.structure-tree-branch.is-current:not(.is-continuing)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  height: 50%;
  border-left: 1px solid #aeb9c7;
}

.structure-tree-branch.is-current::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 0;
  top: 50%;
  border-top: 1px solid #aeb9c7;
}

.structure-cell {
  min-width: 0;
  padding: 0 8px 0 0;
}

.structure-cell--name {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 0;
}

.structure-row--root .structure-cell--name {
  padding-left: 0;
}

.structure-cell--position,
.structure-cell--designation {
  padding-right: 6px;
  font-size: 11px;
  text-align: center;
  color: #4f5966;
}

.structure-text {
  min-width: 0;
  display: block;
  overflow: hidden;
}

.structure-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-label {
  font-size: 12px;
  line-height: 1;
}

.structure-label--part {
  display: flex;
  align-items: center;
}

.structure-label__text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.structure-name {
  color: #1f2730;
}

.structure-meta {
  font-size: 11px;
  color: #66717d;
}

.structure-kind {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 400;
  color: #788493;
}

.structure-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 1px solid #718097;
  background: linear-gradient(180deg, #ffffff, #dfe6ef);
  position: relative;
}

.structure-icon--model::before,
.structure-icon--part::before,
.structure-icon--part::after,
.structure-icon--assemblyUnit::before,
.structure-icon--block::before,
.structure-icon--semiFinished::before,
.structure-icon--assembly::before,
.structure-icon--layer::before,
.structure-icon--fastener::before,
.structure-icon--object::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
}

.structure-icon--model::before {
  top: 3px;
  bottom: 3px;
  border: 1px solid #5f6d84;
  background: linear-gradient(180deg, #fefefe, #e7edf5);
}

.structure-icon--part {
  background: linear-gradient(180deg, #f8fbff, #d9e2ef);
}

.structure-icon--part::before {
  top: 3px;
  height: 2px;
  background: #39404a;
  box-shadow: 0 3px 0 #39404a, 0 6px 0 #39404a;
}

.structure-icon--assemblyUnit::before,
.structure-icon--block::before,
.structure-icon--semiFinished::before,
.structure-icon--assembly::before,
.structure-icon--layer::before,
.structure-icon--fastener::before,
.structure-icon--object::before {
  top: 3px;
  bottom: 3px;
  border: 1px solid #59697d;
}

.structure-icon--assemblyUnit::before {
  background: #d3a648;
}

.structure-icon--block::before {
  background: #7fa8d6;
}

.structure-icon--semiFinished::before {
  background: #76b58a;
}

.structure-icon--assembly::before {
  background: #b18bd8;
}

.structure-icon--layer::before {
  background: #9aa8b9;
}

.structure-icon--fastener::before {
  border-radius: 50%;
  background: #d7896b;
}

.structure-icon--object::before {
  background: #c5ccd5;
}

.structure-markers {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.structure-marker {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  vertical-align: middle;
}

.structure-marker--contour {
  border-radius: 999px;
  background: linear-gradient(180deg, #7db2ff, #2d73da);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(27, 73, 153, 0.75);
}

.structure-marker--groove {
  width: 10px;
  border: 1px solid #9a6207;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffd77c, #e79a18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.structure-marker--groove::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 3px;
  height: 1px;
  background: #714500;
}

.structure-marker--hole {
  border: 2px solid #8750be;
  border-radius: 999px;
  background: #f7efff;
  box-shadow: 0 0 0 1px rgba(76, 37, 119, 0.25);
}

.structure-empty {
  padding: 10px 12px;
  border-top: 1px solid #d9e0e8;
  color: #66717d;
  font-size: 12px;
  background: linear-gradient(180deg, #ffffff, #f3f6fa);
}

.material-card {
  border: 1px solid #c4ccd6;
  background: linear-gradient(180deg, #f8fafc, #e7ecf3);
  margin-bottom: 8px;
}

.material-card.active {
  border-color: #a67925;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 166, 0.65);
}

.material-card-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px 7px;
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.material-card-button:hover {
  background: linear-gradient(180deg, #fff8e5, #efdfb1);
}

.material-card-title {
  font-size: 13px;
  font-weight: 700;
}

.material-card-meta {
  font-size: 11px;
  color: var(--muted);
}

.material-parts-list {
  display: grid;
  gap: 0;
  padding: 0 6px 6px;
}

.material-create-part-button {
  margin-top: 4px;
}

.part-list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-bottom-color: #c4ccd6;
  background: linear-gradient(180deg, #fefefe, #edf1f6);
  padding: 2px 4px;
}

.part-list-row:hover {
  background: linear-gradient(180deg, #fff7df, #f0dfae);
}

.part-list-row.active {
  border-color: #a67925;
  background: linear-gradient(180deg, #fff0c8, #e7ca83);
}

.part-list-select-button {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.part-list-edit-button {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #b27116;
  background: linear-gradient(180deg, #fffdf7, #f0d48f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.part-list-edit-button:hover {
  background: linear-gradient(180deg, #fff4c9, #e5b64d);
}

.part-list-edit-button__icon {
  width: 12px;
  height: 12px;
}

.part-list-edit-button:focus-visible,
.part-list-select-button:focus-visible {
  outline: 1px solid #234f94;
  outline-offset: 1px;
}




.part-list-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.part-list-name {
  font-weight: 700;
}

.part-list-meta {
  font-size: 12px;
  color: var(--muted);
}

.part-list-row--non-rectangular {
  position: relative;
  padding-right: 20px;
}

.part-list-row--non-rectangular::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7db2ff, #2d73da);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 1px rgba(27, 73, 153, 0.75);
  transform: translateY(-50%);
}
.edit-tool-button[hidden] {
  display: none;
}
.field {
  display: grid;
  gap: 5px;
}

.field label {
  font-size: 12px;
  color: var(--muted);
}

.field input,
.field select {
  height: 30px;
  border: 1px solid #98a2af;
  background: #ffffff;
  padding: 4px 8px;
}

.field input:disabled,
.field select:disabled {
  background: #eef1f5;
  color: #66717d;
  cursor: not-allowed;
}

.material-field-control {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 6px;
}

.material-picker-button {
  height: 30px;
  border: 1px solid #98a2af;
  background: linear-gradient(180deg, #ffffff, #dfe5ee);
  color: #1f2730;
  font-weight: 700;
  cursor: pointer;
}

.material-picker-button:hover,
.material-picker-button:focus-visible {
  border-color: #5f7fae;
  background: linear-gradient(180deg, #ffffff, #cfe1f9);
  outline: none;
}

.part-material-picker {
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #98a2af;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(39, 48, 62, 0.18);
}

.part-material-picker__option {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid #e0e5ec;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.part-material-picker__option:hover,
.part-material-picker__option:focus-visible,
.part-material-picker__option.is-active {
  background: #dbeafe;
  outline: none;
}

.part-material-picker__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1f2730;
  font-weight: 700;
}

.part-material-picker__meta {
  color: #66717d;
  font-size: 11px;
}

.part-edge-section {
  display: grid;
  gap: 8px;
}

.part-edge-section__title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.part-edge-section__rows {
  display: grid;
  gap: 8px;
}

.part-edge-row {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #c9d1dc;
  background: #f8fafc;
}

.part-edge-row__header {
  display: grid;
  grid-template-columns: minmax(72px, 0.72fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.part-edge-row__label {
  color: #4d5865;
  font-size: 11px;
  font-weight: 700;
}

.part-edge-row__value {
  min-width: 0;
}

.part-edge-row__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.part-edge-row__actions .tool-button {
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

.properties-panel {
  padding: 0;
  background: #ffffff;
}

.properties-panel > .properties-header {
  height: 23px;
  padding: 3px 7px;
  font-size: 12px;
  line-height: 16px;
}

.properties-body {
  margin-top: 0;
  gap: 0;
  align-content: stretch;
  overflow: auto;
  background: #ffffff;
}

#partMeta {
  color: #111111;
  font: 11px/1.2 Tahoma, "Segoe UI", sans-serif;
}

.bazis-property-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #ffffff;
  color: #111111;
  font: 11px/1.2 Tahoma, "Segoe UI", sans-serif;
}

.bazis-property-object-select {
  width: calc(100% - 6px);
  height: 21px;
  margin: 3px;
  padding: 0 18px 0 4px;
  border: 1px solid #aeb4bc;
  background: #ffffff;
  color: #111111;
  font: 11px Tahoma, "Segoe UI", sans-serif;
}

.bazis-property-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(82px, var(--bazis-property-name-width, 44%)) minmax(0, 1fr);
  align-content: start;
  position: relative;
  border-top: 1px solid #d5d8dd;
  border-left: 1px solid #e2e4e8;
  background: #ffffff;
}

.bazis-property-grid__header {
  min-height: 20px;
  padding: 4px 6px 3px;
  border-right: 1px solid #d7dbe1;
  border-bottom: 1px solid #cfd4db;
  background: #ffffff;
  color: #111111;
  font: 11px/1.2 Tahoma, "Segoe UI", sans-serif;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bazis-property-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(82px, var(--bazis-property-name-width, 44%)) minmax(0, 1fr);
  min-height: 20px;
}

.bazis-property-column-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--bazis-property-name-width, 44%);
  width: 7px;
  transform: translateX(-3px);
  z-index: 2;
  cursor: col-resize;
  background: transparent;
}

.bazis-property-column-resizer:hover,
.bazis-property-column-resizer:focus-visible {
  background: rgba(67, 102, 150, 0.18);
  outline: none;
}

.bazis-property-name,
.bazis-property-value {
  min-width: 0;
  min-height: 20px;
  display: flex;
  align-items: center;
  border-right: 1px solid #e1e4e9;
  border-bottom: 1px dotted #d3d7de;
  background: #ffffff;
  font: 11px/1.2 Tahoma, "Segoe UI", sans-serif;
  overflow: hidden;
}

.bazis-property-name {
  gap: 3px;
  padding: 2px 5px 2px calc(5px + (var(--property-level, 0) * 13px));
  color: #111111;
  overflow: hidden;
}

.bazis-property-name > span {
  min-width: 0;
  flex: 1 1 auto;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bazis-property-value {
  padding: 1px 6px;
  color: #111111;
}

.bazis-property-row--group .bazis-property-name,
.bazis-property-row--group .bazis-property-value {
  font-weight: 400;
}

.bazis-property-row--child .bazis-property-name {
  color: #1f2730;
}

.bazis-property-row--muted .bazis-property-value,
.bazis-property-row--muted .bazis-property-text {
  color: #9aa0a9;
}

.bazis-property-expander {
  width: 9px;
  height: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 9px;
  border: 1px solid #9ea8b5;
  color: #394657;
  font-size: 9px;
  line-height: 8px;
  background: #f7f9fc;
  padding: 0;
  cursor: pointer;
}

.bazis-property-expander:hover,
.bazis-property-expander:focus-visible {
  border-color: #5f7fae;
  background: #e6f0ff;
  outline: none;
}

.bazis-property-expander--blank {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.bazis-property-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bazis-property-value input,
.bazis-property-value select {
  width: 100%;
  min-width: 0;
  height: 18px;
  padding: 1px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #111111;
  font: 11px Tahoma, "Segoe UI", sans-serif;
}

.bazis-property-value input:focus,
.bazis-property-value select:focus {
  border-color: #6b93c8;
  background: #ffffff;
  outline: none;
}

.bazis-property-value input[readonly] {
  color: #111111;
}

.bazis-property-value input:disabled,
.bazis-property-value select:disabled {
  color: #9aa0a9;
  background: transparent;
}

.bazis-property-swatch-value,
.bazis-property-swatch-value span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.bazis-property-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex: 0 0 12px;
  border: 1px solid #262626;
}

.bazis-material-value {
  width: 100%;
  min-width: 0;
}

.bazis-property-value .material-field-control {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 3px;
}

.bazis-property-value .material-picker-button {
  height: 18px;
  padding: 0;
  font-size: 11px;
  line-height: 16px;
}

.bazis-property-value .part-material-picker {
  margin-top: 2px;
  max-height: 180px;
  font-size: 11px;
}

.bazis-property-value .part-material-picker__option {
  padding: 4px 6px;
}

.bazis-property-row.part-edge-row {
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.bazis-property-edge-value {
  display: grid;
  grid-template-columns: minmax(40px, 0.7fr) minmax(74px, 1fr) 58px;
  gap: 2px;
  align-items: stretch;
}

.bazis-property-edge-value .part-edge-row__value,
.bazis-property-edge-value .part-edge-row__select {
  height: 18px;
}

.bazis-property-edge-value .part-edge-row__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.bazis-property-edge-value .part-edge-row__actions .tool-button {
  min-width: 0;
  height: 18px;
  padding: 0;
  border-radius: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}

.bazis-property-grid > .property-actions {
  grid-column: 1 / -1;
  padding: 4px;
  border-top: 1px solid #d9dde4;
}

.bazis-property-grid > .property-actions .tool-button {
  height: 22px;
  min-height: 0;
  font-size: 11px;
}

body.is-resizing-property-column,
body.is-resizing-property-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.properties-note {
  line-height: 1.35;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ghost {
  background: linear-gradient(180deg, #f7f8fa, #d9dfe8);
}

.secondary {
  background: linear-gradient(180deg, #f6f9ff, #cbd9f2);
}

.canvas-card {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.canvas-stage {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  transition: background 0.18s ease;
}

#scene3dCanvas,
#editor2d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

#scene3dCanvas {
  z-index: 1;
  pointer-events: none;
}

body[data-canvas-theme="dark"] .canvas-stage {
  background-color: #616375;
}

body[data-canvas-theme="dark"][data-grid="on"] .canvas-stage {
  background-image: none;
}

body[data-canvas-theme="dark"][data-grid="off"] .canvas-stage {
  background-image: none;
}

body[data-canvas-theme="light"] .canvas-stage {
  background-color: #ffffff;
}

body[data-canvas-theme="light"][data-grid="on"] .canvas-stage {
  background-image: none;
}

body[data-canvas-theme="light"][data-grid="off"] .canvas-stage {
  background-image: none;
}

#editor2d {
  z-index: 3;
  cursor: var(--projection-crosshair-cursor);
}

.properties-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.properties-header {
  height: 28px;
  padding: 5px 8px;
  border: 1px solid #69717e;
  background: linear-gradient(180deg, #505762, #2f343c);
  color: #ffffff;
  font-weight: 700;
}

.properties-body {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
}

.properties-field {
  width: 100%;
}

.property-submit {
  width: 100%;
}

.property-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.meta-value strong {
  color: var(--ink);
}

.point-handle {
  cursor: grab;
  stroke: white;
}
@media (max-width: 1500px) {
  :root {
    --workbench-sidebar-width: 280px;
    --workbench-properties-width: 280px;
  }

  .workbench {
    grid-template-columns:
      42px
      var(--workbench-sidebar-width)
      var(--workbench-resizer-width)
      minmax(0, 1fr)
      var(--workbench-resizer-width)
      var(--workbench-properties-width);
  }
}

@media (max-width: 1200px) {
  :root {
    --workbench-sidebar-width: 260px;
  }

  .workbench {
    grid-template-columns:
      42px
      var(--workbench-sidebar-width)
      var(--workbench-resizer-width)
      minmax(0, 1fr);
  }

  .properties-panel,
  .workbench-resizer--right {
    display: none;
  }
}

.language-button {
  min-width: 52px;
  margin-left: 0;
}

.menu-strip .language-button {
  height: 22px;
  min-width: 52px;
  padding: 0 10px;
}

.editor-toolbar[hidden] {
  display: none !important;
}
.tool-stack {
  display: grid;
  gap: 6px;
}

.edge-band-library-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(34, 41, 51, 0.22);
}

.edge-band-library-overlay[hidden] {
  display: none !important;
}

.edge-band-library-window {
  width: min(1146px, calc(100vw - 48px));
  height: min(930px, calc(100vh - 48px));
  max-height: min(930px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #7b858f;
  background: linear-gradient(180deg, #eef2f6, #d9e0e8);
  box-shadow: 0 14px 30px rgba(27, 34, 46, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.material-library-window {
  width: min(1605px, calc(100vw - 48px));
}

.edge-band-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #8f99a6;
  background: linear-gradient(180deg, #d8dce2, #b7bec8);
}

.edge-band-library-close {
  min-width: 120px;
}

.edge-band-library-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  padding: 12px;
}

.edge-band-library-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.edge-band-library-panel--list {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.edge-band-library-panel--form {
  grid-template-rows: auto auto auto;
  align-content: start;
}

.edge-band-library-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.edge-band-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #c4ccd6;
  background: linear-gradient(180deg, #fbfcfe, #e7ecf3);
}

.edge-band-list-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.edge-band-table,
.material-library-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.edge-band-table thead th,
.material-library-table thead th {
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid #aeb7c2;
  background: linear-gradient(180deg, #eef2f6, #d3dbe5);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.edge-band-table thead th:nth-child(1) {
  width: calc(100% - 44.6ch - 5px);
}

.edge-band-table thead th:nth-child(2) {
  width: 19.6ch;
}

.edge-band-table thead th:nth-child(3) {
  width: 8ch;
}

.edge-band-table thead th:nth-child(4) {
  width: 7ch;
}

.edge-band-table thead th:nth-child(5) {
  width: 10ch;
}

.material-library-table thead th:nth-child(1) {
  width: calc(100% - 59ch - 6px);
}

.material-library-table thead th:nth-child(2) {
  width: 21ch;
}

.material-library-table thead th:nth-child(3) {
  width: 9ch;
}

.material-library-table thead th:nth-child(4) {
  width: 9ch;
}

.material-library-table thead th:nth-child(5) {
  width: 10ch;
}

.material-library-table thead th:nth-child(6) {
  width: 10ch;
}

.edge-band-table-row,
.material-library-table-row {
  cursor: pointer;
}

.edge-band-table-row td,
.material-library-table-row td {
  box-sizing: border-box;
  padding: 8px 10px;
  border-bottom: 1px solid #d0d7e0;
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edge-band-table-row:hover,
.material-library-table-row:hover {
  background: linear-gradient(180deg, #fff8e4, #efdca9);
}

.edge-band-table-row.active,
.material-library-table-row.active {
  background: linear-gradient(180deg, #fff0c8, #e7ca83);
}

.edge-band-table-row.active td,
.material-library-table-row.active td {
  border-bottom-color: #c9a45b;
}

.edge-band-library-empty {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  padding: 10px;
}

.edge-band-library-form {
  display: grid;
  gap: 10px;
}

.edge-band-library-form input[readonly] {
  background: #eef1f5;
  color: #66717d;
  cursor: default;
}

.material-color-input {
  width: 100%;
  padding: 2px;
}

.material-color-cell {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.material-color-swatch {
  flex: 0 0 auto;
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid #6f7885;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  vertical-align: middle;
}

.edge-band-library-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-window {
  width: min(1180px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
}

.settings-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.settings-tabs {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #eef2f6, #dce3eb);
  box-shadow: var(--panel-shadow);
}

.settings-tab {
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #9da7b4;
  background: linear-gradient(180deg, #ffffff, #dfe6ef);
  color: #1f2730;
  text-align: left;
  cursor: pointer;
}

.settings-tab:hover,
.settings-tab:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #fff3c7, #efd186);
  outline: none;
}

.settings-tab.is-active {
  border-color: #7b5822;
  background: linear-gradient(180deg, #ffe6a7, #efb84b);
  font-weight: 700;
}

.settings-panel {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.settings-panel-content {
  display: grid;
  gap: 14px;
}

.settings-live-hint {
  padding: 8px 10px;
  border: 1px solid #c6d3e4;
  background: linear-gradient(180deg, #f5f9ff, #e2ecfb);
  color: #435065;
  font-size: 12px;
  line-height: 1.4;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.settings-form-grid--camera {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  align-items: center;
}

.settings-slider-row input[type="range"] {
  width: 100%;
}

.settings-color-input {
  width: 100%;
  min-height: 40px;
  padding: 4px;
  border: 1px solid #8f99a6;
  background: linear-gradient(180deg, #ffffff, #e7ebf1);
  cursor: pointer;
}

.settings-field-note {
  margin-top: 4px;
  color: #5b6672;
  font-size: 11px;
  line-height: 1.35;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.snap-diagnostic-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 28, 36, 0.38);
}

.snap-diagnostic-overlay[hidden] {
  display: none;
}

.snap-diagnostic-panel {
  width: min(920px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(240px, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid #687382;
  background: #eef2f6;
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.snap-diagnostic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.snap-diagnostic-header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.snap-diagnostic-close,
.snap-diagnostic-actions button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #8f99a6;
  background: linear-gradient(180deg, #ffffff, #dfe6ef);
  color: #1f2730;
  cursor: pointer;
}

.snap-diagnostic-close:hover,
.snap-diagnostic-close:focus-visible,
.snap-diagnostic-actions button:hover,
.snap-diagnostic-actions button:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #fff3c7, #efd186);
  outline: none;
}

.snap-diagnostic-help {
  margin: 0;
  color: #435065;
  font-size: 12px;
  line-height: 1.4;
}

.snap-diagnostic-text {
  width: 100%;
  min-height: 240px;
  resize: none;
  padding: 8px;
  border: 1px solid #8f99a6;
  background: #ffffff;
  color: #111820;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
}

.snap-diagnostic-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .edge-band-library-body {
    grid-template-columns: 1fr;
  }

  .edge-band-library-actions {
    grid-template-columns: 1fr;
  }

  .settings-body,
  .settings-form-grid,
  .settings-form-grid--camera,
  .settings-actions {
    grid-template-columns: 1fr;
  }
}

.ui-icon__2d-text {
  fill: currentColor;
  stroke: none;
  font: 700 7px/1 "Segoe UI", sans-serif;
}

.part2d-viewer-button {
  margin-left: 8px;
  border-color: #d89538;
  background: linear-gradient(180deg, #fffdf5, #f5e3bd);
  color: #9b5f08;
}

.part2d-viewer-button:hover,
.part2d-viewer-button:focus-visible {
  border-color: #f39225;
  background: linear-gradient(180deg, #fff7dd, #f7c96c);
  outline: none;
}

body.part2d-viewer-open {
  overflow: hidden;
}

.part2d-viewer[hidden] {
  display: none;
}

.part2d-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #ffffff;
  color: var(--ink);
  font-family: Tahoma, "Segoe UI", sans-serif;
}

.part2d-viewer__dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
}

.part2d-viewer__header {
  display: flex;
  align-items: center;
  min-height: 41px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--chrome-line);
  background: linear-gradient(180deg, var(--chrome-top), var(--chrome-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.part2d-viewer__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #1f2730;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part2d-viewer__close {
  display: grid;
  place-items: center;
  width: var(--toolbar-square);
  height: var(--toolbar-square);
  margin-left: 10px;
  padding: 0;
  border: 1px solid #8f99a6;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #d8dde6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color: #2f3b4a;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.part2d-viewer__close:hover,
.part2d-viewer__close:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
  color: #222933;
  outline: none;
}

.part2d-viewer__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 39px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #eef2f6, #dce3eb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow-x: auto;
}

.part2d-viewer__tabs button {
  align-self: center;
  min-width: max-content;
  min-height: 29px;
  padding: 0 12px;
  border: 1px solid #9da7b4;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #dfe6ef);
  color: #2f3b4a;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.part2d-viewer__tabs button:hover,
.part2d-viewer__tabs button:focus-visible,
.part2d-viewer__tabs button.is-active {
  border-color: var(--accent-border);
  color: #222933;
  outline: none;
}

.part2d-viewer__tabs button.is-active {
  border-color: #7b5822;
  background: linear-gradient(180deg, #ffe6a7, #efb84b);
  font-weight: 700;
}

.part2d-viewer__tabs button:hover,
.part2d-viewer__tabs button:focus-visible {
  background: linear-gradient(180deg, #fff3c7, #efd186);
}

.part2d-viewer__body {
  display: grid;
  grid-template-rows: minmax(300px, 58vh) minmax(170px, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.part2d-viewer__drawing {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
  background: #ffffff;
}

.part2d-viewer__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.part2d-viewer__dimension-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.part2d-viewer__canvas:active {
  cursor: grabbing;
}

.part2d-viewer__mirror {
  position: absolute;
  top: 9px;
  left: 50%;
  z-index: 4;
  max-width: min(520px, 72vw);
  transform: translateX(-50%);
  padding: 5px 10px;
  border: 1px solid #9da7b4;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #dfe6ef);
  box-shadow: var(--panel-shadow);
  color: #354153;
  font-size: 11px;
  pointer-events: none;
}

.part2d-viewer__zoom {
  position: absolute;
  right: 14px;
  top: 50%;
  z-index: 4;
  display: grid;
  gap: 4px;
  transform: translateY(-50%);
}

.part2d-viewer__zoom button {
  display: grid;
  place-items: center;
  width: var(--toolbar-square);
  height: var(--toolbar-square);
  padding: 0;
  border: 1px solid #8f99a6;
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  background: linear-gradient(180deg, #ffffff, #d8dde6);
  color: #2f3b4a;
  font-size: 19px;
  cursor: pointer;
}

.part2d-viewer__zoom button:hover,
.part2d-viewer__zoom button:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
  color: #222933;
  outline: none;
}

.part2d-viewer__zoom svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.part2d-viewer__filters {
  position: absolute;
  left: 12px;
  right: 62px;
  bottom: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 2px 0;
}

.part2d-viewer__chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 27px;
  padding: 3px 8px;
  border: 1px solid #9da7b4;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #dfe6ef);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color: #2f3b4a;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.part2d-viewer__chip:hover,
.part2d-viewer__chip:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #fff3c7, #efd186);
  outline: none;
}

.part2d-viewer__chip > span,
.part2d-viewer__dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.part2d-viewer__chip.is-off {
  border-color: #b4bcc7;
  background: linear-gradient(180deg, #f0f2f6, #d5dbe4);
  opacity: 0.58;
  text-decoration: line-through;
}

.part2d-viewer__holes {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: #ffffff;
}

.part2d-viewer__hint {
  padding: 6px 10px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #f5f7fa, #dce3eb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 11px;
}

.part2d-viewer__hole-list {
  min-height: 0;
  overflow: auto;
}

.part2d-viewer__groove-section[hidden] {
  display: none;
}

.part2d-viewer__groove-section {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.part2d-viewer__section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 33px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #f5f7fa, #dce3eb);
  color: #4b5664;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.part2d-viewer__section-header strong {
  color: #293544;
  font-size: 12px;
}

.part2d-viewer__section-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 125px;
  background: #ffffff;
}

.part2d-viewer__section-profile {
  fill: rgba(118, 82, 214, 0.08);
  stroke: #7652d6;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.part2d-viewer__section-dimension {
  fill: none;
  stroke: #df8a0d;
  stroke-width: 1.15;
}

.part2d-viewer__section-dimension text {
  fill: #bd6900;
  stroke: #ffffff;
  stroke-width: 4px;
  paint-order: stroke fill;
  font: 700 12px "Segoe UI", sans-serif;
  text-anchor: middle;
  dominant-baseline: central;
}

.part2d-viewer__section-dimension--radius circle {
  fill: #df8a0d;
  stroke: none;
}

.part2d-viewer__section-svg marker path {
  fill: #df8a0d;
  stroke: none;
}

.part2d-viewer__section-hint {
  padding: 4px 10px 5px;
  border-top: 1px solid #e2e6eb;
  color: #7b8692;
  font-size: 10px;
  text-align: center;
}

.part2d-viewer__hole-row {
  display: grid;
  grid-template-columns: 28px 10px minmax(170px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-bottom: 1px solid #d5dbe4;
  background: #ffffff;
  color: #2f3b4a;
  text-align: left;
  cursor: pointer;
}

.part2d-viewer__hole-row:hover,
.part2d-viewer__hole-row:focus-visible,
.part2d-viewer__hole-row.is-selected {
  background: linear-gradient(180deg, #fff8e3, #f3e2af);
  outline: none;
}

.part2d-viewer__hole-row.is-selected {
  box-shadow: inset 3px 0 var(--accent-border);
}

.part2d-viewer__hole-number {
  color: #89939e;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.part2d-viewer__hole-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.part2d-viewer__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #b6a9d4;
  border-radius: 0;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
}

.part2d-viewer__badge--face {
  background: linear-gradient(180deg, #f5f1ff, #ded4f6);
  color: #6044a8;
}

.part2d-viewer__badge--dark {
  margin-left: 5px;
  border-color: #25303a;
  background: linear-gradient(180deg, #505762, #2f343c);
  color: #fff;
}

.part2d-viewer__coords {
  color: #7a858f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.part2d-viewer__axis-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-top: 1px solid #1fb36d;
  border-left: 1px solid #e75454;
}

.part2d-viewer__empty {
  padding: 28px 16px;
  color: #87919c;
  font-size: 12px;
  text-align: center;
}

.part2d-viewer__footer {
  display: flex;
  justify-content: center;
  padding: 6px 10px;
  border-top: 1px solid var(--chrome-line);
  background: linear-gradient(180deg, var(--chrome-top), var(--chrome-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.part2d-viewer__footer button {
  width: min(360px, 100%);
  min-height: 31px;
  border: 1px solid #8f99a6;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #d8dde6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color: #2f3b4a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.part2d-viewer__footer button:hover,
.part2d-viewer__footer button:focus-visible {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, #ffe9ae, #efbb52);
  outline: none;
}

@media (max-width: 760px) {
  .part2d-viewer__body {
    grid-template-rows: minmax(250px, 54vh) minmax(150px, 1fr);
  }

  .part2d-viewer__hole-row {
    grid-template-columns: 24px 9px minmax(120px, 1fr) auto;
  }

  .part2d-viewer__coords {
    display: none;
  }
}
