/* CAD Studio workspace: a route-level application, not a page embed. */
body.cadstudio-route {
  margin: 0;
  background: #101821;
}

body.cadstudio-route > header.site,
body.cadstudio-route > footer.site {
  display: none;
}
body.cadstudio-route > main {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.cadstudio-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #1c2936;
  color: #d7e1eb;
}
.cadstudio-app:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #1c2936;
}

.ws-appbar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  background: #111b26;
  border-bottom: 1px solid #0a1119;
  flex: 0 0 auto;
}
.ws-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f1f6fb;
  text-decoration: none;
}
.ws-brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #52769b;
  color: #8fc1f5;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}
.ws-brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.ws-brand b {
  font-size: 13px;
  letter-spacing: 0.01em;
}
.ws-brand small {
  margin-top: 3px;
  color: #7890a7;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ws-project {
  justify-self: center;
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.ws-project-name {
  font-size: 12px;
  font-weight: 700;
  color: #e7eef5;
}
.ws-local {
  color: #7890a7;
  font-size: 10px;
}

.ws-local[data-state="unavailable"] {
  color: #ffb4a9;
}

.ws-local[data-state="unavailable"] i {
  background: #ff6b5f;
}

.ws-local[data-state="saving"] i {
  background: #f2c14e;
}
.ws-agent-activity {
  display: inline-grid;
  grid-template-columns: 7px auto;
  grid-template-areas: 'dot name' 'dot status';
  align-items: center;
  column-gap: 6px;
  min-height: 32px;
  margin-left: 6px;
  padding: 3px 8px;
  border: 1px solid #31516e;
  border-radius: 3px;
  background: #162433;
  color: #d9e8f5;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ws-agent-activity[hidden] { display: none; }
.ws-agent-activity > span {
  grid-area: dot;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #50d890;
  box-shadow: 0 0 0 3px rgb(80 216 144 / 12%);
}
.ws-agent-activity[data-state='attention'] > span { background: #f2c14e; }
.ws-agent-activity[data-state='error'] > span { background: #ff6b5f; }
.ws-agent-activity b {
  grid-area: name;
  max-width: 150px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-agent-activity small {
  grid-area: status;
  max-width: 180px;
  overflow: hidden;
  color: #86a0b8;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A flight-recorder, not a simulated chat window. Every row is sourced from
   the structured agent or CAD runtime and uses the compact visual language of
   aerospace maintenance logs. */
.ws-agent-flight-recorder {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
  border-top: 2px solid #4db4ff;
  border-bottom: 1px solid #0a1118;
  background: #0b1117;
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}
.ws-agent-flight-recorder[hidden] { display: none; }
.ws-agent-flight-recorder .wsp-head {
  min-height: 34px;
  padding: 6px 7px 5px 10px;
  background: #121d27;
}
.ws-agent-flight-recorder .wsp-head > span {
  display: grid;
  gap: 2px;
}
.ws-agent-flight-recorder .wsp-head b {
  color: #d9e7f1;
  font-size: 10px;
  letter-spacing: .09em;
}
.ws-agent-flight-recorder .wsp-head small {
  color: #6f879e;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.ws-agent-flight-recorder[data-state='running'] .wsp-head small { color: #7fc8ff; }
.ws-agent-flight-recorder[data-state='attention'] {
  border-top-color: #d79a43;
}
.ws-agent-flight-recorder[data-state='attention'] .wsp-head small { color: #e8b86e; }
.ws-agent-flight-recorder[data-state='error'] {
  border-top-color: #e47769;
}
.ws-agent-flight-recorder[data-state='error'] .wsp-head small { color: #ff9b8e; }
.ws-agent-flight-recorder .wsp-head button {
  width: 26px;
  min-height: 24px;
  padding: 0;
  border: 1px solid #2b4052;
  border-radius: 2px;
  background: #101922;
  color: #86a1b8;
  cursor: pointer;
}
.ws-agent-flight-recorder-body {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  min-height: 0;
  background:
    linear-gradient(90deg, rgba(77, 180, 255, .035) 1px, transparent 1px) 0 0 / 16px 100%,
    #0b1117;
}
.ws-agent-flight-recorder[data-collapsed='true'] .ws-agent-flight-recorder-body { display: none; }
.ws-agent-flight-recorder-rail {
  position: relative;
  border-right: 1px solid #20313f;
  background: #0e171f;
}
.ws-agent-flight-recorder-rail i {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4db4ff;
  box-shadow: 0 0 0 3px rgba(77, 180, 255, .11);
}
.ws-agent-flight-recorder-rail span {
  position: absolute;
  left: 6px;
  bottom: 8px;
  color: #48657d;
  font: 700 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .14em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
#bw-agent-flight-recorder-log {
  min-height: 78px;
  max-height: 198px;
  margin: 0;
  padding: 5px 0 7px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #2b4357 #0b1117;
  list-style: none;
  color: #a7b8c9;
  font: 9px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
#bw-agent-flight-recorder-log:empty::before {
  display: block;
  padding: 8px 9px;
  color: #63798c;
  content: 'Awaiting structured CAD events…';
}
.ws-agent-flight-record {
  display: grid;
  grid-template-columns: 42px 51px minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  padding: 3px 8px;
  border-left: 2px solid transparent;
}
.ws-agent-flight-record + .ws-agent-flight-record { border-top: 1px solid rgba(255, 255, 255, .026); }
.ws-agent-flight-record time { color: #526b7f; }
.ws-agent-flight-record b {
  overflow: hidden;
  color: #6f879e;
  font-size: 8px;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-agent-flight-record span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ws-agent-flight-record[data-kind='ok'] { border-left-color: #4db4ff; }
.ws-agent-flight-record[data-kind='ok'] b { color: #75bce9; }
.ws-agent-flight-record[data-kind='attention'] { border-left-color: #d79a43; color: #e4c28e; }
.ws-agent-flight-record[data-kind='attention'] b { color: #d79a43; }
.ws-agent-flight-record[data-kind='error'] { border-left-color: #e47769; color: #ffb1a7; }
.ws-agent-flight-record[data-kind='error'] b { color: #e47769; }
.ws-agent-flight-record[data-kind='turbine'] { border-left-color: #b77936; }
.ws-agent-flight-record[data-kind='turbine'] b { color: #c98c4a; }

.cadstudio-app .ws-origin .assembly-row > button[data-occurrence-action='select'],
.cadstudio-app .ws-origin .mate-row > button[data-mate-action='select'],
.cadstudio-app .ws-origin .inspection-row > button:first-child {
  display: block;
  width: auto;
  padding: 0 6px;
  text-align: left;
}

@media (min-width: 1280px) {
  .cadstudio-app[data-document-kind='assembly'] .ws-tree { flex-basis: 292px; }
  .cadstudio-app[data-document-kind='assembly'] .ws-side { flex-basis: 310px; }
}

.ws-agent-pair {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #415d78;
  border-radius: 4px;
  background: #16222e;
  color: #dce8f2;
  box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
}
.ws-agent-pair::backdrop { background: rgb(4 10 16 / 76%); }
.ws-agent-pair form { padding: 24px; }
.ws-agent-pair .ws-agent-kicker {
  margin: 0 0 8px;
  color: #7fbfff;
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .14em;
}
.ws-agent-pair h2 { margin: 0 0 10px; font-size: 20px; }
.ws-agent-pair p { color: #9eb2c5; line-height: 1.5; }
.ws-agent-pair dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 20px 0;
  padding: 14px;
  background: #101b26;
}
.ws-agent-pair dt { color: #71889f; font-size: 10px; text-transform: uppercase; }
.ws-agent-pair dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.ws-agent-pair form > div { display: flex; justify-content: flex-end; gap: 8px; }
.ws-agent-pair button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #40576c;
  border-radius: 3px;
  background: #1f2d3a;
  color: #dce8f2;
  font: inherit;
  cursor: pointer;
}
.ws-agent-pair button.primary { border-color: #2784d8; background: #1669b4; color: #fff; }
.ws-agent-pair button.ws-agent-danger { border-color: #8b4545; color: #ffb8b0; }
.ws-agent-url {
  display: grid;
  gap: 7px;
  margin: 18px 0 8px;
  color: #9eb2c5;
  font-size: 11px;
}
.ws-agent-url input {
  min-height: 40px;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #40576c;
  border-radius: 3px;
  background: #0d1822;
  color: #e7f0f7;
  padding: 0 10px;
  font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-agent-inline-error { margin: 7px 0; color: #ffb8b0 !important; font-size: 11px; }
.ws-app-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ws-app-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #cbd8e5;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.ws-app-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
}
.ws-app-icon .ws-icon {
  width: 16px;
  height: 16px;
}
.ws-app-actions button:hover,
.ws-app-actions button[aria-pressed='true'] {
  border-color: #3a5470;
  background: #22303f;
  color: #fff;
}

.ws-ribbon {
  display: flex;
  background: #22303f;
  border-bottom: 1px solid #141d27;
  overflow-x: auto;
  flex: 0 0 auto;
  scrollbar-width: thin;
}
.ws-group {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #141d27;
  padding: 5px 8px 2px;
  flex: 0 0 auto;
}
.wsg-tools {
  display: flex;
  gap: 3px;
}
.wsg-title {
  text-align: center;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #7d92a8;
  margin-top: 2px;
}
.wsr-btn {
  font: inherit;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 44px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  color: #d7e1eb;
  cursor: pointer;
}
.wsr-btn .wsr-i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-bottom: 1px;
  line-height: 1;
}
.ws-icon {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
  pointer-events: none;
}
.wsr-btn:hover {
  background: #2c3e52;
  border-color: #3a5470;
}
.wsr-btn.on,
.wsr-btn[aria-pressed='true'] {
  background: #0b5cad;
  border-color: #0b5cad;
  color: #fff;
}
.wsr-accent {
  color: #8fc1f5;
}
.wsr-file {
  position: relative;
}

.ws-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
#bw-studio {
  position: relative;
  flex: 1;
  min-width: 0;
  background: linear-gradient(#212f3e, #1a2634);
  overflow: hidden;
}
#bw-studio > canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.ws-side {
  flex: 0 0 264px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #141d27;
  border-left: 1px solid #141d27;
  overflow-y: auto;
}
.wsp {
  background: #22303f;
  display: flex;
  flex-direction: column;
}
.wsp-grow {
  flex: 1;
}
.wsp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px 4px;
  color: #a9bacb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wsp-head button {
  font: inherit;
  font-size: 14px;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  background: none;
  color: #8fc1f5;
  cursor: pointer;
}
.wsp-body {
  padding: 4px 8px 10px;
  font-size: 12.5px;
  color: #d7e1eb;
}

.ws-mtabs {
  display: none;
}

.mode-label {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2;
  margin: 0;
  font-size: 12px;
  color: #cfe0f1;
  background: rgba(20, 29, 39, 0.75);
  border-radius: 4px;
  padding: 3px 9px;
  pointer-events: none;
  max-width: 70%;
}

.ws-cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #141d27;
  border-top: 1px solid #0d141c;
  padding: 5px 12px;
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #cfe0f1;
  min-height: 32px;
}
.ws-cmd-err {
  color: #f3a09a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-cmd-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.ws-cmd-actions button {
  font: inherit;
  font-size: 12px;
  padding: 3px 12px;
  min-height: 26px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #22303f;
  color: #d7e1eb;
  cursor: pointer;
}
.ws-cmd-actions #bw-cmd-apply {
  background: #0b5cad;
  border-color: #0b5cad;
  color: #fff;
}
.ws-status {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #0b5cad;
  color: #dbeafc;
  font-size: 11.5px;
  padding: 4px 12px;
  flex: 0 0 auto;
}
.ws-status .ws-status-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ws-status a,
.ws-status button {
  color: #fff;
}
.ws-status button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* context properties (side stack on desktop; bottom sheet on mobile) */
#bw-context label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}
#bw-context input[type='text'] {
  width: 86px;
  font: inherit;
  font-size: 12.5px;
  padding: 4px 6px;
  min-height: 28px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #1a2634;
  color: #e8f0f8;
}
#bw-context .ctx-t {
  font-weight: 700;
  margin: 2px 0;
}
#bw-context .ctx-sub {
  color: #a9bacb;
  font-size: 11.5px;
  margin: 0 0 6px;
}
#bw-context .ctx-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
#bw-context .ctx-actions button {
  font: inherit;
  font-size: 12px;
  padding: 5px 12px;
  min-height: 30px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #22303f;
  color: #d7e1eb;
  cursor: pointer;
}
#bw-context .ctx-stat {
  color: #a9bacb;
  font-size: 12px;
  margin: 4px 0;
}
#bw-context .ctx-check {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 0;
}
#bw-context input.field-err {
  border-color: #e74c3c;
}
#bw-context .err-msg,
.sk-bottom .err-msg {
  display: block;
  color: #f3a09a;
  font-size: 11px;
  margin: 2px 0 0;
}

@media (max-width: 760px) {
  .cadstudio-app {
    height: 100vh;
    height: 100dvh;
  }
  /* The panel stack collapses on phones into bottom sheets reached
     through the tab bar (Parameters / History) or by selecting a
     feature (Properties). position:fixed cannot escape a display:none
     ancestor, so hide the individual panels, not the aside. */
  .ws-side {
    display: contents;
  }
  .ws-side .wsp {
    display: none;
  }
  #bw-context-wrap:not([hidden]),
  .ws-side.m-open-params .wsp-params,
  .ws-side.m-open-history .wsp-history {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bw-sheet-bottom, 0px);
    z-index: 30;
    background: #22303f;
    color: #d7e1eb;
    border-top: 1px solid #3a5470;
    border-radius: 10px 10px 0 0;
    max-height: 45%;
    overflow-y: auto;
    padding: 4px 10px 10px;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
  }
  /* an open tab sheet yields to the properties sheet */
  .ws-side.m-open-params #bw-context-wrap:not([hidden]) ~ .wsp-params,
  .ws-side.m-open-history #bw-context-wrap:not([hidden]) ~ .wsp-history {
    display: none;
  }
  /* the earlier 60vh stage height (old page layout, later media block)
     would overflow the app column and paint the canvas over the tab bar */
  .cadstudio-app #bw-studio {
    height: auto;
    min-height: 0;
  }
  .ws-mtabs {
    display: flex;
    gap: 1px;
    background: #141d27;
  }
  .ws-mtabs button {
    flex: 1;
    font: inherit;
    font-size: 13px;
    min-height: 44px;
    border: 0;
    background: #22303f;
    color: #d7e1eb;
    cursor: pointer;
  }
  .ws-mtabs button[aria-pressed='true'] {
    background: #315a86;
    color: #fff;
  }
  .wsr-btn {
    min-width: 48px;
    min-height: 44px;
  }
}

#bw-v1-notice {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  max-width: 80%;
  background: #fff8e6;
  border: 1px solid #e0c46b;
  color: #5d4a12;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
}
#bw-v1-notice button {
  font: inherit;
  font-size: 12px;
  margin-left: 8px;
  padding: 2px 10px;
  border: 1px solid #c9ad55;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

#bw-studio-msg {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 3;
  background: #1a3550;
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 5px;
  max-width: 80%;
  pointer-events: none;
}

.ws-agent-narration {
  position: absolute;
  left: 50%;
  bottom: 84px;
  z-index: 6;
  width: min(760px, calc(100% - 160px));
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
}
.ws-agent-narration > span {
  display: inline-block;
  padding: 8px 14px 9px;
  border: 1px solid rgba(187, 213, 238, .25);
  border-radius: 4px;
  background: rgba(5, 11, 17, .9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .34);
  color: #f4f8fb;
  font: 600 14px/1.35 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .005em;
  text-wrap: balance;
  -webkit-font-smoothing: antialiased;
  backdrop-filter: blur(8px);
}
.ws-agent-narration[data-avoid-dialog='true'] {
  left: 38%;
  width: min(560px, calc(100% - 96px));
}
.ws-agent-narration[data-kind='warning'] > span,
.ws-agent-narration[data-kind='attention'] > span {
  border-color: rgba(242, 185, 77, .55);
  color: #fff0c9;
}
.cadstudio-app .is-agent-revealed {
  outline: 1px solid rgba(92, 169, 246, .72);
  outline-offset: -1px;
}
@media (max-width: 760px) {
  .ws-agent-narration {
    bottom: 96px;
    width: calc(100% - 24px);
  }
  .ws-agent-narration > span {
    padding: 7px 11px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ws-agent-narration {
    transition: none;
  }
}

/* Project transitions stay inside the CAD shell. Recoverable template changes
   use a quiet instrument-style toast; only unfinished edits and destructive
   Clear actions interrupt with a decision panel. */
.ws-decision {
  width: min(470px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #dce6ef;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ws-decision::backdrop {
  background: rgba(4, 9, 14, .72);
  backdrop-filter: blur(2px);
}
.ws-decision-card {
  overflow: hidden;
  border: 1px solid #45617d;
  border-top: 3px solid #4d9ae8;
  border-radius: 4px;
  background: #172532;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .62);
}
.ws-decision-card header {
  padding: 18px 20px 13px;
  border-bottom: 1px solid #2e4559;
  background: #121e29;
}
.ws-decision-card header span {
  color: #79afe1;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.ws-decision-card h2 {
  margin: 6px 0 0;
  color: #f2f7fb;
  font-size: 18px;
  letter-spacing: -.015em;
}
.ws-decision-card > p {
  margin: 0;
  padding: 17px 20px;
  color: #a9bac9;
  font-size: 12px;
  line-height: 1.55;
}
.ws-decision-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 14px;
  border-top: 1px solid #2e4559;
  background: #111c26;
}
.ws-decision-card button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #3d5871;
  border-radius: 3px;
  background: #203142;
  color: #d8e3ec;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ws-decision-card button:hover { border-color: #6487a8; background: #283d50; }
.ws-decision-card button:focus-visible { outline: 2px solid #82bfff; outline-offset: 2px; }
.ws-decision-card .ws-primary { border-color: #4d9ae8; background: #1768b1; color: #fff; }
.ws-decision-card .ws-primary:hover { background: #2179c6; }
.ws-decision-discard { color: #efc4bc !important; }
.ws-decision-danger .ws-decision-card { border-top-color: #d6745f; }
.ws-decision-danger .ws-decision-card header span { color: #e7a191; }
.ws-decision-card .ws-danger { border-color: #b85d4b; background: #8d3f32; color: #fff; }
.ws-decision-card .ws-danger:hover { background: #a84d3d; }

.ws-transition-toast {
  position: absolute;
  right: 18px;
  bottom: 42px;
  z-index: 45;
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto 28px;
  align-items: center;
  gap: 10px;
  width: min(440px, calc(100% - 36px));
  min-height: 58px;
  padding: 8px 8px 8px 10px;
  border: 1px solid #426786;
  border-left: 3px solid #4d9ae8;
  border-radius: 3px;
  background: rgba(18, 31, 43, .97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .48);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 180ms ease;
}
.ws-transition-toast.is-visible { opacity: 1; transform: translateY(0); }
.ws-transition-toast[hidden] { display: none; }
.ws-transition-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #365b7c;
  background: #142b3f;
  color: #83c2fa;
}
.ws-transition-icon { width: 17px; height: 17px; }
#bw-transition-status { display: grid; gap: 3px; min-width: 0; }
#bw-transition-status strong { overflow: hidden; color: #edf5fb; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
#bw-transition-status small { color: #8ea5b8; font-size: 9.5px; line-height: 1.3; }
.ws-transition-toast button {
  min-height: 34px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #9fd0ff;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.ws-transition-toast button:hover { background: #1d3a53; color: #d9ecff; }
.ws-transition-toast button:focus-visible { outline: 2px solid #82bfff; outline-offset: 1px; }
.ws-transition-action { padding: 0 11px; border: 1px solid #356b9e !important; }
.ws-transition-action[hidden] { display: none; }
.ws-transition-close { width: 28px; padding: 0; color: #7890a4 !important; font-size: 17px !important; }

@media (max-width: 600px) {
  .ws-decision-card footer { display: grid; grid-template-columns: 1fr; }
  .ws-decision-card button { min-height: 44px; }
  .ws-decision-card .ws-primary { grid-row: 1; }
  .ws-transition-toast {
    right: 10px;
    bottom: 58px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    width: calc(100% - 20px);
  }
  .ws-transition-close { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-transition-toast { transition: none; }
}

/* First run is guidance inside the tool, over the actual modeling surface. */
.ws-welcome {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(13, 21, 30, 0.44);
}
.ws-welcome[hidden] {
  display: none;
}
.ws-welcome-card {
  width: min(760px, 100%);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  border: 1px solid #45617d;
  border-top: 3px solid #4d9ae8;
  border-radius: 4px;
  background: rgba(24, 36, 49, 0.97);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  padding: 26px 28px 22px;
}
.ws-welcome-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.ws-welcome-count {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 6px 8px;
  border: 1px solid #3c5a75;
  background: #1b2b3b;
  color: #9fc8ef;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ws-welcome-kicker {
  margin: 0 0 8px;
  color: #8fc1f5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ws-welcome h1 {
  margin: 0;
  padding: 0;
  border: 0;
  color: #f5f8fb;
  font-family: inherit;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.ws-welcome-lede {
  max-width: 610px;
  margin: 9px 0 18px;
  color: #b9c7d4;
  font-size: 13px;
  line-height: 1.5;
}
.ws-welcome-status {
  color: #9db6cd;
  font-size: 13px;
  margin: 14px 0 0;
}
.ws-welcome-popular {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 16px;
}
.ws-welcome-popular button {
  display: grid;
  grid-template-rows: 72px auto auto;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #354e67;
  border-radius: 2px;
  background: #1a2a39;
  color: #dce6ef;
  text-align: left;
  cursor: pointer;
}
.ws-welcome-popular button:hover,
.ws-welcome-popular button:focus-visible {
  border-color: #75afe5;
  background: #20364a;
}
.ws-welcome-popular b { font-size: 11px; }
.ws-welcome-popular small { overflow: hidden; color: #8298ad; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ws-template-mini {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid #283e52;
  background-color: #13202c;
  background-image: linear-gradient(#1d3041 1px, transparent 1px), linear-gradient(90deg, #1d3041 1px, transparent 1px);
  background-size: 10px 10px;
}
.ws-template-mini::before,
.ws-template-mini::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}
.ws-template-mini::before { width: 64px; height: 38px; border: 2px solid #78a8d3; background: rgba(67, 126, 180, .16); transform: translate(-50%, -45%) skewY(-10deg); }
.ws-template-mini[data-shape="plate"]::after { width: 14px; height: 9px; border: 2px solid #8fc1ef; border-radius: 50%; }
.ws-template-mini[data-shape="tray"]::before { border-width: 7px 5px; }
.ws-template-mini[data-shape="mount"]::after { width: 48px; height: 25px; background: radial-gradient(circle at 3px 3px, #8fc1ef 0 2px, transparent 2.5px) 0 0 / 42px 19px; }
.ws-template-mini[data-shape="knob"]::before { width: 42px; height: 42px; border-radius: 50%; transform: translate(-50%, -50%); }
.ws-template-mini[data-shape="knob"]::after { width: 19px; height: 19px; border: 2px solid #8fc1ef; border-radius: 50%; }
.ws-template-mini[data-shape="engine"]::before {
  width: 62px;
  height: 8px;
  border: 1px solid #7891a8;
  background: #586d80;
  box-shadow: -17px 0 0 5px #71879b, 0 0 0 7px #52697e, 18px 0 0 6px #9b6a36, 33px 0 0 4px #687d90;
  transform: translate(-42%, -50%);
}
.ws-template-mini[data-shape="engine"]::after {
  left: 26%;
  width: 40px;
  height: 40px;
  border: 2px solid #a9bbc9;
  border-radius: 50%;
  background: repeating-conic-gradient(from 4deg, #91a6b8 0 4deg, transparent 4deg 15deg);
}
.ws-welcome-steps {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: start-steps;
}
.ws-welcome-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  padding: 10px 0 10px 36px;
  border-top: 1px solid #2c4054;
  counter-increment: start-steps;
}
.ws-welcome-steps li:last-child {
  border-bottom: 1px solid #2c4054;
}
.ws-welcome-steps li::before {
  content: counter(start-steps, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 11px;
  color: #6f8eac;
  font: 700 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-welcome-steps b {
  color: #e8eef5;
  font-size: 12px;
}
.ws-welcome-steps span {
  color: #8ea1b4;
  font-size: 11px;
}
.ws-welcome-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 6px;
}
.ws-welcome-actions button,
.ws-help-link {
  min-height: 44px;
  border: 1px solid #3c5874;
  border-radius: 3px;
  background: #223345;
  color: #dce6ef;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

/* Template library: a parts cabinet, with the selected part's construction
   recipe visible before it replaces the current document. */
.ws-templates {
  width: min(1180px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #45617d;
  border-radius: 3px;
  background: #14212d;
  color: #dce6ef;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .58);
}
.ws-templates::backdrop { background: rgba(5, 10, 16, .76); }
.ws-template-shell { display: flex; flex-direction: column; height: 100%; }
.ws-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 62px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #30485f;
  background: #111b25;
}
.ws-template-head span,
.ws-template-filter > p,
.ws-template-eyebrow {
  color: #7691aa;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.ws-template-head h2 { margin: 4px 0 0; color: #f1f6fa; font-size: 18px; letter-spacing: -.01em; }
.ws-template-head button {
  width: 44px;
  height: 44px;
  border: 1px solid #3b5670;
  border-radius: 2px;
  background: #1b2b3b;
  color: #eef5fa;
  font: 24px/1 system-ui, sans-serif;
  cursor: pointer;
}
.ws-template-workbench { display: grid; grid-template-columns: 176px minmax(360px, 1fr) 318px; min-height: 0; flex: 1; }
.ws-template-filter { display: flex; flex-direction: column; padding: 18px 12px; border-right: 1px solid #2d4357; background: #111c27; }
.ws-template-filter > p { margin: 0 8px 12px; }
.ws-template-filter nav { display: grid; gap: 3px; }
.ws-template-filter nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #aebdcb;
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.ws-template-filter nav button span { color: #657e94; font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ws-template-filter nav button:hover { background: #1a2a39; color: #eef5fa; }
.ws-template-filter nav button[aria-pressed="true"] { border-color: #356b9e; background: #173653; color: #9fd0ff; }
.ws-template-note { display: grid; gap: 6px; margin-top: auto; padding: 12px 9px; border-top: 1px solid #2d4357; }
.ws-template-note b { color: #b9d9f5; font-size: 10px; }
.ws-template-note span { color: #71869a; font-size: 9.5px; line-height: 1.45; }
.ws-template-browser { min-width: 0; min-height: 0; padding: 16px; overflow: hidden; }
.ws-template-search { display: grid; gap: 5px; }
.ws-template-search span { color: #91a5b9; font-size: 10px; font-weight: 700; }
.ws-template-search input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #3c5872;
  border-radius: 2px;
  background: #0f1923;
  color: #eef5fa;
  font: inherit;
  font-size: 12px;
}
.ws-template-results { display: flex; justify-content: space-between; gap: 10px; padding: 10px 1px; color: #71879b; font-size: 9px; }
.ws-template-results span:first-child { color: #abc0d3; font-weight: 700; }
.ws-template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  height: calc(100% - 83px);
  overflow-y: auto;
  padding: 0 3px 14px 0;
}
.ws-template-list,
.ws-template-detail,
.ws-template-workbench {
  scrollbar-width: thin;
  scrollbar-color: #526d84 #101a24;
}
.ws-template-list::-webkit-scrollbar,
.ws-template-detail::-webkit-scrollbar,
.ws-template-workbench::-webkit-scrollbar { width: 8px; height: 8px; }
.ws-template-list::-webkit-scrollbar-track,
.ws-template-detail::-webkit-scrollbar-track,
.ws-template-workbench::-webkit-scrollbar-track { background: #101a24; }
.ws-template-list::-webkit-scrollbar-thumb,
.ws-template-detail::-webkit-scrollbar-thumb,
.ws-template-workbench::-webkit-scrollbar-thumb { border: 2px solid #101a24; border-radius: 8px; background: #526d84; }
.ws-template-card {
  display: grid;
  grid-template-rows: 84px auto auto;
  gap: 5px;
  min-height: 138px;
  padding: 8px;
  border: 1px solid #2e465c;
  border-radius: 2px;
  background: #172634;
  color: #dce6ef;
  text-align: left;
  cursor: pointer;
}
.ws-template-card:hover { border-color: #507a9f; background: #1a2d3e; }
.ws-template-card[aria-selected="true"] { border-color: #58a2e7; box-shadow: inset 0 0 0 1px #2f76b8; background: #19334b; }
.ws-template-card .ws-template-mini { height: 84px; }
.ws-template-card b { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.ws-template-card small { color: #7c91a5; font-size: 8.5px; }
.ws-template-detail { min-width: 0; overflow-y: auto; padding: 16px 18px 18px; border-left: 1px solid #2d4357; background: #152432; }
.ws-template-preview {
  height: 180px;
  margin: 0 0 15px;
  border: 1px solid #314b63;
  background-color: #101a24;
  background-image: linear-gradient(#1e3040 1px, transparent 1px), linear-gradient(90deg, #1e3040 1px, transparent 1px);
  background-size: 14px 14px;
}
.ws-template-preview svg { width: 100%; height: 100%; color: #86b5df; }
.ws-template-preview .solid { fill: rgba(58, 119, 171, .22); stroke: currentColor; stroke-width: 2; }
.ws-template-preview .edge { fill: none; stroke: #b6d5f2; stroke-width: 1.5; }
.ws-template-preview .hidden-edge { fill: none; stroke: #557b9f; stroke-width: 1; stroke-dasharray: 4 4; }
.ws-template-eyebrow { margin: 0 0 7px; color: #79afe1; }
.ws-template-detail h3 { margin: 0; color: #f2f6fa; font-size: 20px; letter-spacing: -.02em; }
.ws-template-detail > p:not(.ws-template-eyebrow) { min-height: 45px; margin: 8px 0 14px; color: #9dafc0; font-size: 11px; line-height: 1.45; }
.ws-template-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 15px; }
.ws-template-facts div { padding: 8px; border: 1px solid #2d465d; background: #111d28; }
.ws-template-facts dt { color: #6f879c; font-size: 8px; text-transform: uppercase; }
.ws-template-facts dd { margin: 4px 0 0; color: #cdd9e4; font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ws-template-recipe { margin: 0 0 16px; }
.ws-template-recipe > b { color: #718aa0; font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.ws-template-recipe ol { margin: 8px 0 0; padding: 0; list-style: none; counter-reset: recipe; }
.ws-template-recipe li { position: relative; min-height: 31px; padding: 0 0 9px 32px; color: #c4d1dd; font-size: 10px; counter-increment: recipe; }
.ws-template-recipe li::before { content: counter(recipe, decimal-leading-zero); position: absolute; left: 0; top: -2px; display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #3b6387; border-radius: 50%; background: #142a3d; color: #8fc4f3; font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ws-template-recipe li:not(:last-child)::after { content: ''; position: absolute; left: 11px; top: 21px; width: 1px; height: 12px; background: #3b6387; }
.ws-template-detail > .ws-primary,
.cs-help-actions button,
.cs-help-actions a,
.ws-tour .ws-primary {
  min-height: 42px;
  border: 1px solid #1976d2;
  border-radius: 2px;
  background: #0b5cad;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ws-template-detail > .ws-primary { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 12px; }
.ws-template-detail > .ws-primary:disabled { border-color: #3b4d5d; background: #263542; color: #738493; cursor: default; }
.cs-help-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.cs-help-actions button,
.cs-help-actions a { display: inline-flex; align-items: center; padding: 0 12px; text-decoration: none; }
.cs-help-actions > :not(:first-child) { border-color: #45617d; background: #203447; }
.cs-agent-note { margin: -3px 0 14px; color: #91a8bc; font-size: 11px; line-height: 1.5; }

/* The tour points at live controls; the soft outline travels through the app
   while the concise card stays out of the user's working area. */
.ws-tour { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }
.ws-tour[hidden] { display: none; }
.ws-tour-target { position: relative; z-index: 1002 !important; outline: 3px solid #73b9f7 !important; outline-offset: 4px; box-shadow: 0 0 0 9999px rgba(4, 9, 14, .55), 0 0 26px rgba(69, 157, 236, .7) !important; }
.ws-tour-card { position: fixed; left: 50%; bottom: 40px; width: min(390px, calc(100vw - 24px)); padding: 16px 17px; border: 1px solid #5a84aa; border-top: 3px solid #58aaf2; border-radius: 3px; background: #172737; color: #dce6ef; box-shadow: 0 16px 50px rgba(0, 0, 0, .55); transform: translateX(-50%); pointer-events: auto; }
.ws-tour-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-tour-progress span { color: #7fb4e3; font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
.ws-tour-progress button { padding: 0; border: 0; background: transparent; color: #8fa4b7; font: inherit; font-size: 10px; text-decoration: underline; cursor: pointer; }
.ws-tour h2 { margin: 11px 0 5px; color: #f3f7fa; font-size: 17px; }
.ws-tour p { margin: 0 0 14px; color: #aebdcc; font-size: 11.5px; line-height: 1.5; }
.ws-tour-actions { display: flex; justify-content: flex-end; gap: 7px; }
.ws-tour-actions button { min-width: 76px; min-height: 38px; padding: 0 12px; border: 1px solid #405b74; border-radius: 2px; background: #203244; color: #dce6ef; font: inherit; font-size: 10px; cursor: pointer; }
.ws-welcome-actions button:hover,
.ws-help-link:hover {
  border-color: #71a6da;
  background: #2a4055;
}
.ws-welcome-actions .ws-primary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 13px;
  border-color: #1976d2;
  background: #0b5cad;
  color: #fff;
  font-weight: 700;
}
.ws-help-link {
  min-height: 34px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8fc1f5;
  text-decoration: underline;
}

/* Help is a deliberate in-app drawer: reference stays one click away and
   never extends the modeling page. */
.ws-help {
  width: min(760px, calc(100vw - 32px));
  height: min(850px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  margin: auto 16px auto auto;
  padding: 0;
  border: 1px solid #45617d;
  border-radius: 4px;
  background: #172432;
  color: #d7e1eb;
  box-shadow: -16px 0 60px rgba(0, 0, 0, 0.45);
}
.ws-help::backdrop {
  background: rgba(5, 10, 16, 0.66);
}
.ws-help-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ws-help-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid #2d4358;
  background: #111b26;
}
.ws-help-head span {
  color: #7f98b1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ws-help-head h2 {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  color: #f2f6fa;
  font-family: inherit;
  font-size: 18px;
}
.ws-help-head button {
  width: 40px;
  height: 40px;
  border: 1px solid #38516a;
  border-radius: 3px;
  background: #1d2d3d;
  color: #eef4fa;
  font: 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
.ws-help-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 30px;
}
.ws-help-body section {
  margin: 0;
  padding: 18px 0 22px;
  border-bottom: 1px solid #2d4358;
}
.ws-help-body section:first-child {
  padding-top: 0;
}
.ws-help-body h3 {
  margin: 0 0 12px;
  color: #f0f5fa;
  font-size: 14px;
}
.cs-steps {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
}
.cs-steps li {
  margin: 8px 0;
}
.cs-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  font-size: 12.5px;
  line-height: 1.5;
}
.cs-cols p {
  margin: 4px 0 0;
  color: #aebdcb;
}
.cs-faq p {
  color: #aebdcb;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 10px 0;
}
.ws-help a {
  color: #8fc1f5;
}
.ws-help code,
.cs-shortcuts dt {
  color: #d9e8f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-recover {
  width: min(520px, calc(100vw - 32px));
  height: min(520px, calc(100dvh - 32px));
}
.ws-recover-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.ws-recover-body > p:first-child {
  margin: 0 0 16px;
  color: #9fb0c0;
  font-size: 12px;
  line-height: 1.5;
}
.ws-recovery-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ws-recovery-project > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0 7px;
  color: #dce7f1;
  font-size: 12px;
}
.ws-recovery-project > h3 span {
  padding: 3px 5px;
  border: 1px solid #396b98;
  border-radius: 2px;
  color: #8fc5fa;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.ws-recovery-project > ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ws-recovery-list button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid #34506a;
  border-radius: 3px;
  background: #1b2d3d;
  color: #d8e4ef;
  text-align: left;
  cursor: pointer;
}
.ws-recovery-list button:hover,
.ws-recovery-list button:focus-visible {
  border-color: #5c91c4;
  background: #20384d;
  outline: none;
}
.ws-recovery-list b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.ws-recovery-list time,
.ws-recovery-list small {
  color: #8fa5b9;
  font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-recovery-list small {
  grid-column: 1 / -1;
}
.cs-shortcuts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin: 0;
}
.cs-shortcuts dl div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #26394b;
}
.cs-shortcuts dt,
.cs-shortcuts dd {
  margin: 0;
  font-size: 11.5px;
}
.cs-shortcuts dd {
  color: #9caec0;
}
.cs-shortcuts > p {
  margin: 0 0 10px;
  color: #9caec0;
  font-size: 11.5px;
  line-height: 1.5;
}
.cs-shortcut-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin-top: 14px;
}
.cs-shortcut-editor label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px;
  align-items: center;
  gap: 8px;
  color: #b8c7d5;
  font-size: 11px;
}
.cs-shortcut-editor select,
#bw-shortcut-reset {
  min-height: 30px;
  border: 1px solid #3a5670;
  border-radius: 3px;
  background: #172a3a;
  color: #d9e7f2;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cs-shortcut-editor select { padding: 0 7px; }
#bw-shortcut-reset {
  margin-top: 10px;
  padding: 0 10px;
  cursor: pointer;
}
#bw-shortcut-reset:hover { border-color: #5ca7ed; background: #194d7d; }

/* parameters panel */
#bw-params {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.param-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.param-row input {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 6px;
  min-height: 28px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #1a2634;
  color: #e8f0f8;
  min-width: 0;
}
.param-row input[data-pname] {
  flex: 1.2;
}
.param-row input[data-pval] {
  flex: 1;
}
.param-row button {
  font: inherit;
  font-size: 12px;
  padding: 2px 7px;
  min-width: 28px;
  min-height: 28px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #22303f;
  color: #d7e1eb;
  cursor: pointer;
}
.pick-bar input[type='text'] {
  width: 70px;
  font: inherit;
  font-size: 12.5px;
  padding: 2px 5px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #1a2634;
  color: #e8f0f8;
}
.sk-top input[type='text'] {
  width: 70px;
  font: inherit;
  font-size: 12.5px;
  padding: 2px 5px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #1a2634;
  color: #e8f0f8;
}

/* feature history */
.hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hist-item {
  border: 1px solid #3a5470;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 12.5px;
  background: #1a2634;
  cursor: pointer;
}
.hist-item.err {
  border-color: #e74c3c;
  background: #35222a;
}
.hist-item.sel {
  border-color: #4c9aff;
  box-shadow: 0 0 0 1px #4c9aff inset;
}
.hist-item.rollback { border-style: double; border-width: 3px; }
.hist-item.rollback .hi-n::after { content: '  · rollback'; color: #8fc1f5; font-weight: 500; }
.hist-item.rolled-back { opacity: .52; border-style: dashed; }
.hist-item.dragging { opacity: .35; }
/* selection is marked by shape as well as colour */
.hist-item.sel .hi-n::before {
  content: '\25B8 ';
}
.hist-item .hi-sel {
  display: block;
  width: 100%;
  font: inherit;
  text-align: left;
  padding: 0;
  margin: 0 0 2px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.hist-item .hi-sel:focus-visible {
  outline: 2px solid #8fc1f5;
  outline-offset: 1px;
}
.hist-item .hi-n {
  font-weight: 700;
  display: block;
}
.hist-item .hi-d {
  color: #a9bacb;
  display: block;
  margin: 1px 0 4px;
}
.hist-item .hi-a button {
  font: inherit;
  font-size: 11.5px;
  padding: 2px 8px;
  min-height: 26px;
  margin-right: 4px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #22303f;
  color: #d7e1eb;
  cursor: pointer;
}
.hist-item .hi-a button[aria-pressed='true'] { border-color: #8fc1f5; color: #fff; }
.hist-item .hi-a button:disabled { opacity: .35; cursor: default; }

/* Schema-5 body rows reuse the existing model-tree density and palette. */
.ws-bodies-panel { flex: 0 1 auto; max-height: 42%; overflow-y: auto; border-bottom: 1px solid var(--v3-line-soft); }
.body-tree {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.body-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  padding: 5px;
  border: 1px solid #334d65;
  border-radius: 4px;
  background: #182633;
}
.body-row.is-selected { border-color: #4c9aff; box-shadow: inset 0 0 0 1px #4c9aff; }
.body-row.is-active .body-select::before { content: '\25B8'; margin-right: 4px; color: #7fc0fa; }
.body-row.is-suppressed { border-style: dashed; opacity: .68; }
.body-row.is-failed { border-color: #e16a5b; background: #35252a; }
.body-select {
  min-width: 0;
  padding: 2px 3px;
  border: 0;
  background: transparent;
  color: #e5edf4;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.body-select small { display: block; margin-top: 2px; color: #8298aa; font-size: 8.5px; font-weight: 500; }
.body-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; align-items: start; gap: 2px; }
.body-actions button,
.body-actions label {
  display: grid;
  min-width: 25px;
  min-height: 25px;
  place-items: center;
  margin: 0;
  padding: 0 4px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #22303f;
  color: #d7e1eb;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}
.body-actions input { width: 13px; height: 13px; margin: 0; accent-color: #4c9aff; }
#bw-sk-result-row { display: inline-flex; align-items: center; gap: 8px; }
#bw-sk-result-row[hidden] { display: none; }
#bw-sk-result-row input,
#bw-sk-result-row select { min-height: 28px; border: 1px solid #3a5470; border-radius: 3px; background: #1a2634; color: #e8f0f8; font: inherit; font-size: 11px; }
#bw-sk-body-name { width: 105px; padding: 0 6px; }
#bw-sk-target { max-width: 130px; }
.ctx-body-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.ctx-body-actions button { min-height: 31px; border: 1px solid #3a5470; border-radius: 3px; background: #223447; color: #dce7f1; font: inherit; font-size: 10px; cursor: pointer; }
.ctx-body-actions button.is-danger { border-color: #7e4a48; color: #ffbbb4; }
.ctx-body-name { display: grid; gap: 4px; color: #8fa5b9; font-size: 9px; }
.ctx-body-name input { min-width: 0; min-height: 32px; padding: 0 7px; border: 1px solid #3a5470; border-radius: 3px; background: #172633; color: #eef5fa; font: inherit; }
@media (max-width: 760px) {
  .ws-bodies-panel { max-height: none; overflow: visible; }
  .body-actions { flex-wrap: wrap; }
  .body-actions button,
  .body-actions label { min-width: 44px; min-height: 44px; }
}
.sr-file {
  font-size: 13.5px;
  text-align: left;
  padding: 7px 10px;
  border: 1px solid #c8ced5;
  border-radius: 5px;
  background: #fff;
  color: #1a3550;
  cursor: pointer;
}
.sr-file:hover {
  background: #f0f5fa;
}

/* edge pick bar (fillet / chamfer) */
.pick-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: rgba(34, 48, 63, 0.95);
  color: #d7e1eb;
  border: 1px solid #3a5470;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.pick-bar b {
  color: #eef4fa;
}
.pick-bar button {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  min-height: 30px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #22303f;
  color: #d7e1eb;
  cursor: pointer;
}
.pick-bar button.sr-accent {
  background: #0b5cad;
  color: #fff;
  border-color: #0b5cad;
  font-weight: 600;
}
.pick-bar input[type='number'] {
  width: 60px;
  font: inherit;
  font-size: 12.5px;
  padding: 2px 5px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #1a2634;
  color: #e8f0f8;
}

/* sketch overlay — same dark CAD surface as the 3D workspace */
#bw-sketch {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #1a2531;
  color: #d7e1eb;
  display: flex;
  flex-direction: column;
}
.sk-top,
.sk-bottom {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #22303f;
  border-bottom: 1px solid #141d27;
  font-size: 13px;
}
.sk-top b {
  color: #eef4fa;
}
.sk-bottom {
  border-bottom: 0;
  border-top: 1px solid #141d27;
  min-height: 34px;
  /* A large constrained sketch renders many dimension fields; the strip must
     scroll rather than starve the flex-sized canvas above it of height. */
  max-height: 30vh;
  overflow-y: auto;
}
.sk-top button,
.sk-bottom button {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  min-height: 30px;
  border: 1px solid #3a5470;
  border-radius: 4px;
  background: #22303f;
  color: #d7e1eb;
  cursor: pointer;
}
.sk-top button.on {
  background: #315a86;
  color: #fff;
  border-color: #4c9aff;
}
.sk-top button.sr-accent {
  background: #0b5cad;
  color: #fff;
  border-color: #0b5cad;
  font-weight: 600;
}
.sk-top input[type='number'],
.sk-bottom input[type='number'] {
  width: 64px;
  font: inherit;
  font-size: 12.5px;
  padding: 2px 5px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #1a2634;
  color: #e8f0f8;
}
.sk-top select {
  font: inherit;
  font-size: 12.5px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #1a2634;
  color: #e8f0f8;
  padding: 2px 4px;
}
#bw-sketch-canvas {
  flex: 1 1 0;
  width: 100%;
  height: 0;
  min-width: 0;
  /* The drawing surface wins the height fight: dimension and constraint
     panels scroll inside their own strips instead of starving the canvas. */
  min-height: min(220px, 34vh);
  display: block;
  cursor: crosshair;
  touch-action: none;
}
.sk-pull {
  border-color: #4388c7 !important;
  background: #153f65 !important;
  color: #f3f8fc !important;
  font-weight: 700 !important;
}

/* Direct-manipulation solid preview. The WebGL canvas stays the work surface;
   only the compact numeric palette and drag cue sit above it. */
.ws-presspull {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  color: #e8eef4;
}
.ws-presspull::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 12, 18, .22), transparent 28%);
}
.pp-card {
  position: absolute;
  top: 16px;
  left: 16px;
  width: min(330px, calc(100% - 32px));
  padding: 14px 15px 13px;
  border: 1px solid #40576c;
  border-radius: 3px;
  background: rgba(23, 31, 40, .96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
  pointer-events: auto;
}
.pp-kicker {
  display: block;
  margin-bottom: 4px;
  color: #69a9df;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.pp-card > b { display: block; font-size: 17px; }
.pp-card > p { margin: 5px 0 11px; color: #aebdca; font-size: 12px; line-height: 1.45; }
.pp-card label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}
.pp-card input {
  width: 90px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #4c647a;
  border-radius: 2px;
  background: #0f1821;
  color: #f3f7fb;
  font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pp-actions { display: flex; gap: 7px; margin-top: 12px; }
.pp-actions button {
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #455b6f;
  border-radius: 2px;
  background: #253442;
  color: #e5edf4;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pp-actions .sr-accent { border-color: #1672bd; background: #1268ad; color: #fff; }
.pp-drag-cue {
  position: absolute;
  left: 50%;
  top: 48%;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .65));
}
.pp-drag-cue i {
  display: block;
  width: 2px;
  height: 78px;
  background: #6fb6ec;
  box-shadow: 0 -1px 0 1px #6fb6ec;
}
.pp-drag-cue i::before,
.pp-drag-cue i::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid #6fb6ec;
  border-left: 2px solid #6fb6ec;
}
.pp-drag-cue i::before { top: 1px; transform: translateX(-50%) rotate(45deg); }
.pp-drag-cue i::after { top: 67px; transform: translateX(-50%) rotate(225deg); }
.pp-drag-cue b {
  margin-top: 8px;
  padding: 4px 7px;
  border: 1px solid #69a9df;
  background: #101820;
  color: #eef7ff;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pp-drag-cue span { margin-top: 5px; color: #9ab2c6; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.cadstudio-app.is-presspull #bw-studio > canvas { cursor: ns-resize; }
.sk-note {
  color: #a9bacb;
  font-size: 12px;
}
.sk-dof {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  white-space: nowrap;
}
.sk-dof.is-defined { background: rgba(101, 193, 140, 0.16); color: #65c18c; border: 1px solid rgba(101, 193, 140, 0.45); }
.sk-dof.is-open { background: rgba(230, 176, 34, 0.14); color: #e6b022; border: 1px solid rgba(230, 176, 34, 0.4); }
.sk-dof.is-conflict { background: rgba(224, 82, 82, 0.14); color: #e05252; border: 1px solid rgba(224, 82, 82, 0.45); }
#bw-sk-dims {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
#bw-sk-dims label {
  font-size: 12.5px;
}
.sk-constraint-editor {
  flex: 1 0 100%;
  padding: 7px 9px;
  border: 1px solid #30445a;
  border-radius: 4px;
  background: #111c27;
}
.sk-constraint-editor summary {
  cursor: pointer;
  color: #d8e5f1;
  font-size: 12px;
  font-weight: 700;
}
.sk-constraint-create,
#bw-sk-constraint-fields,
.sk-point-tools,
.sk-constraint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sk-constraint-create { margin-top: 8px; }
/* The add form's own error region: a refused constraint add surfaces the
   solver's actual reason here, next to the form that refused it. */
.sk-constraint-error {
  margin: 6px 0 0;
  padding: 5px 8px;
  border: 1px solid #7a3b47;
  border-radius: 4px;
  background: #2a161d;
  color: #f0b9c4;
  font-size: 11.5px;
  line-height: 1.45;
}
.sk-constraint-error[hidden] { display: none; }
.sk-point-tools {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #30445a;
}
.sk-point-tools strong { color: #91a6ba; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sk-constraint-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-height: 120px;
  overflow: auto;
}
.sk-constraint-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 110px auto;
}
.sk-constraint-row span { color: #91a6ba; font-size: 11px; }
.sk-constraint-row button { justify-self: end; }

@media (max-width: 760px) {
  .sk-constraint-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sk-constraint-row span { grid-column: 1; }
  .sk-constraint-row button { grid-column: 2; grid-row: 1 / 3; }
  .pp-card { top: 10px; left: 10px; width: calc(100% - 20px); padding: 11px 12px; }
  .pp-card > p { display: none; }
  .pp-card label { margin-top: 8px; }
  .pp-actions button, .pp-card input { min-height: 44px; }
  .pp-drag-cue { top: 60%; }
  .ws-appbar {
    grid-template-columns: 1fr auto;
    min-height: 50px;
    gap: 6px;
    padding: 0 6px 0 9px;
  }
  .ws-brand small,
  .ws-project {
    display: none;
  }
  .ws-app-actions button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
  }
  .ws-app-actions button span:last-child:not(:first-child) {
    display: none;
  }
  .ws-welcome {
    place-items: end stretch;
    padding: 10px;
  }
  .ws-welcome-card {
    width: 100%;
    max-height: calc(100dvh - 136px);
    overflow-y: auto;
    padding: 19px 18px 16px;
  }
  .ws-welcome-lede {
    margin-bottom: 14px;
  }
  .ws-welcome-steps {
    margin-bottom: 14px;
  }
  .ws-welcome-steps li {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 0 7px 30px;
  }
  .ws-welcome-steps li::before {
    top: 9px;
  }
  .ws-welcome-actions {
    grid-template-columns: 1fr 1fr;
  }
  .ws-welcome-actions .ws-primary {
    grid-column: 1 / -1;
  }
  .ws-welcome-heading { gap: 8px; }
  .ws-welcome-count { display: none; }
  .ws-welcome-popular { grid-template-columns: 1fr 1fr; }
  .ws-welcome-popular button { grid-template-rows: 46px auto auto; }
  .ws-welcome-popular button:nth-child(n + 3) { display: none; }
  .ws-template-mini { min-height: 46px; }
  .ws-templates {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .ws-template-head { min-height: 58px; padding-left: 13px; }
  .ws-template-head h2 { font-size: 15px; }
  .ws-template-workbench { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; }
  .ws-template-filter { padding: 8px 10px; overflow-x: auto; border: 0; border-bottom: 1px solid #2d4357; }
  .ws-template-filter { scrollbar-width: none; }
  .ws-template-filter::-webkit-scrollbar { display: none; }
  .ws-template-filter > p,
  .ws-template-note { display: none; }
  .ws-template-filter nav { display: flex; min-width: max-content; }
  .ws-template-filter nav button { min-height: 44px; gap: 7px; }
  .ws-template-browser { min-height: 430px; padding: 12px 10px 0; }
  .ws-template-list { grid-template-columns: 1fr 1fr; height: calc(100% - 110px); }
  .ws-template-card { grid-template-rows: 64px auto auto; min-height: 119px; }
  .ws-template-card .ws-template-mini { height: 64px; }
  .ws-template-detail { overflow: visible; padding: 12px; border: 0; border-top: 1px solid #2d4357; }
  .ws-template-preview { display: none; }
  .ws-template-detail > p:not(.ws-template-eyebrow) { min-height: 0; }
  .ws-template-recipe ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .ws-template-recipe li { min-height: 26px; }
  .ws-template-recipe li::after { display: none; }
  .ws-template-detail > .ws-primary { position: sticky; bottom: 0; min-height: 48px; }
  .ws-tour-card { bottom: 12px; }
  .ws-tour-target { box-shadow: 0 0 0 9999px rgba(4, 9, 14, .42), 0 0 18px rgba(69, 157, 236, .65) !important; }
  .ws-help {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .ws-help-body {
    padding: 16px 17px 28px;
  }
  .cs-cols,
  .cs-shortcuts dl {
    grid-template-columns: 1fr;
  }
  .ws-status > span:nth-child(2),
  .ws-status-right a {
    display: none;
  }
}

.cadstudio-app button:focus-visible,
.cadstudio-app a:focus-visible,
.cadstudio-app input:focus-visible,
.cadstudio-app select:focus-visible {
  outline: 2px solid #79b8f5;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cadstudio-app *,
  .cadstudio-app *::before,
  .cadstudio-app *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------
   V3 precision workspace

   The application shell is organised like an engineering instrument:
   document controls, contextual workspaces, a model tree, the canvas, and a
   dedicated inspector. The canvas chrome is the visual signature; everything
   else stays quiet enough for geometry to remain the primary content.
   ---------------------------------------------------------------------- */
.cadstudio-app {
  --v3-ink: #0b121a;
  --v3-rail: #101923;
  --v3-panel: #172330;
  --v3-panel-2: #1c2a38;
  --v3-line: #2a3a4a;
  --v3-line-soft: #202e3c;
  --v3-text: #dce7f2;
  --v3-muted: #8295a9;
  --v3-blue: #2f8cff;
  --v3-blue-deep: #1265c4;
  --v3-amber: #f4a340;
  background: var(--v3-ink);
  color: var(--v3-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.cadstudio-app:fullscreen {
  background: var(--v3-ink);
}
.ws-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* application and document bar */
.cadstudio-app .ws-appbar {
  min-height: 52px;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 18px;
  padding: 0 10px 0 12px;
  background: var(--v3-ink);
  border-bottom-color: #05090e;
  box-shadow: 0 1px rgba(255, 255, 255, 0.025) inset;
}
.cadstudio-app .ws-brand-mark {
  border-color: #3c5a78;
  background: #101d2a;
  color: #85bcf4;
}
.cadstudio-app .ws-brand small {
  color: #667c91;
}
.ws-document {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-width: 250px;
  height: 36px;
  border: 1px solid var(--v3-line);
  border-bottom-color: var(--v3-blue);
  background: #121d28;
  box-shadow: 0 -2px 0 rgba(47, 140, 255, 0.12) inset;
}
.ws-document-kind {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border-right: 1px solid var(--v3-line);
  color: #7790a8;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}
.ws-document .ws-project-name {
  padding: 0 10px;
  color: #edf4fa;
  font-size: 12px;
}
.ws-document .ws-local {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding-right: 10px;
  color: #72869a;
  font-size: 9px;
  white-space: nowrap;
}
.ws-document .ws-local i,
.ws-kernel-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #47c98b;
  box-shadow: 0 0 0 2px rgba(71, 201, 139, 0.12);
}
.cadstudio-app .ws-app-actions,
.ws-edit-actions,
.ws-file-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.ws-edit-actions {
  padding-right: 5px;
  border-right: 1px solid var(--v3-line);
}
.ws-file-actions {
  padding-right: 5px;
  border-right: 1px solid var(--v3-line);
}
.cadstudio-app .ws-app-actions .ws-quick-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #aebdcb;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  text-decoration: none;
}
.cadstudio-app .ws-app-actions .ws-quick-btn:hover,
.cadstudio-app .ws-app-actions .ws-quick-btn[aria-pressed='true'] {
  border-color: #3a526a;
  background: #172534;
  color: #f1f6fb;
}
.cadstudio-app .ws-app-actions .ws-quick-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.ws-quick-icon,
.ws-quick-icon .ws-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
}
.ws-quick-labeled {
  min-width: 58px !important;
}
.ws-export-btn {
  flex-direction: row-reverse;
  color: #8fc5fa !important;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  letter-spacing: 0.04em;
}
.ws-action-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--v3-line);
}
.ws-clear-label {
  display: none;
}

/* contextual workspaces and tool shelf */
.cadstudio-app .ws-ribbon {
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: var(--v3-rail);
  border-bottom-color: #070c11;
}
.ws-workspace-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--v3-line-soft);
  background: #0e1721;
}
.ws-workspaces {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.ws-workspaces button {
  position: relative;
  min-width: 76px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: #8194a8;
  font: 700 10px/1 inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.ws-workspaces button::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: transparent;
}
.ws-workspaces button:hover:not(:disabled):not([aria-disabled='true']) {
  color: #c9d7e4;
  background: rgba(255, 255, 255, 0.025);
}
.ws-workspaces button[aria-selected='true'] {
  color: #f3f7fb;
}
.ws-workspaces button[aria-selected='true']::after {
  background: var(--v3-blue);
  box-shadow: 0 -2px 10px rgba(47, 140, 255, 0.4);
}
.ws-workspaces button:disabled,
.ws-workspaces button[aria-disabled='true'] {
  color: #415262;
  cursor: not-allowed;
}
.ws-workspace-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8799ab;
}
.ws-workspace-state > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--v3-blue);
  box-shadow: 0 0 10px rgba(47, 140, 255, 0.7);
}
.ws-workspace-state b {
  color: #aab9c8;
  font-size: 10px;
}
.ws-workspace-state small {
  padding-left: 7px;
  border-left: 1px solid var(--v3-line);
  color: #62778b;
  font-size: 9px;
}
.ws-ribbon-panel {
  display: flex;
  min-height: 74px;
  padding: 6px 10px 7px;
  background: linear-gradient(180deg, #172330 0%, #131f2a 100%);
  overflow-x: auto;
  scrollbar-width: thin;
}
.ws-ribbon-panel[hidden] {
  display: none;
}
.cadstudio-app .ws-group {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  padding: 0 8px 0 76px;
  border-right-color: var(--v3-line);
}
.cadstudio-app .wsg-title {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  width: 66px;
  margin: 0;
  padding: 0 8px;
  border-right: 1px solid var(--v3-line);
  color: #65798d;
  font-size: 8.5px;
  line-height: 1.35;
  text-align: left;
}
.cadstudio-app .wsg-tools {
  gap: 5px;
}
.cadstudio-app .wsr-btn {
  display: grid;
  grid-template-columns: 30px auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-content: stretch;
  column-gap: 9px;
  min-width: 126px;
  min-height: 58px;
  padding: 6px 10px;
  border-color: transparent;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
  color: #c7d4e0;
  text-align: left;
}
.cadstudio-app .wsr-btn:hover {
  border-color: #3b536b;
  background: #203142;
}
.cadstudio-app .wsr-btn.on,
.cadstudio-app .wsr-btn[aria-pressed='true'] {
  border-color: #438fdf;
  background: linear-gradient(135deg, #176ec8, #0e579f);
  box-shadow: 0 0 0 1px rgba(105, 177, 247, 0.12) inset;
  color: #fff;
}
.cadstudio-app .wsr-btn .wsr-i {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  margin: 0;
  color: #91c8ff;
}
.cadstudio-app .wsr-btn .wsr-i .ws-icon {
  width: 28px;
  height: 28px;
}
.cadstudio-app .wsr-btn[aria-pressed='true'] .wsr-i,
.cadstudio-app .wsr-btn.on .wsr-i {
  color: #fff;
}
.wsr-label {
  align-self: end;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}
.wsr-btn small {
  align-self: start;
  color: #75899d;
  font-size: 8.5px;
  line-height: 1.2;
}
.wsr-btn[aria-pressed='true'] small,
.wsr-btn.on small {
  color: #cce5ff;
}

/* three-column modeling workspace */
.cadstudio-app .ws-main {
  background: var(--v3-ink);
}
.ws-tree,
.cadstudio-app .ws-side {
  flex: 0 0 238px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  background: var(--v3-panel);
}
.ws-tree {
  border-right: 1px solid #080d12;
}
.cadstudio-app .ws-side {
  flex-basis: 280px;
  border-left: 1px solid #080d12;
}
.cadstudio-app.v6-model-tree-closed .ws-tree,
.cadstudio-app.v6-inspector-closed .ws-side,
.cadstudio-app.v6-project-closed .ws-file-actions,
.cadstudio-app.v6-history-closed .wsp-history {
  display: none;
}
.cadstudio-app .is-agent-selected {
  box-shadow: inset 3px 0 #4db4ff;
  background: rgba(40, 126, 196, 0.2);
}
.cadstudio-app [data-v6-focused-action='true'] {
  outline: 2px solid #4db4ff;
  outline-offset: 2px;
}
.ws-v6-diagnostics .wsp-body {
  display: grid;
  gap: 8px;
}
.ws-v6-diagnostics .v6-diagnostic {
  padding: 8px;
  border: 1px solid #654b2c;
  border-radius: 4px;
  background: #2a2118;
  color: #f4d8aa;
  font-size: 11px;
}
.ws-v6-diagnostics .v6-diagnostic.is-error { border-color: #824e49; background: #2c2020; color: #f5c8c2; }
.ws-v6-diagnostics .v6-diagnostic.is-warning { border-color: #745f31; background: #2b261b; }
.ws-v6-diagnostics .v6-diagnostic.is-healthy { border-color: #315f4d; background: #182820; color: #bfe8d4; }
.ws-v6-diagnostics .v6-diagnostic.is-checking { border-color: #3d5d77; background: #172633; color: #c1def2; }
.ws-v6-diagnostics .v6-diagnostic.is-empty { border-color: #405265; background: #18222c; color: #c1cfda; }
.ws-v6-diagnostics .v6-diagnostic p { margin: 5px 0; line-height: 1.45; }
.ws-v6-diagnostics .v6-diagnostic-heading,
.ws-v6-diagnostics .v6-diagnostic-actions,
.ws-v6-diagnostics .v6-diagnostic-inputs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ws-v6-diagnostics .v6-diagnostic-heading { justify-content: space-between; }
.ws-v6-diagnostics .v6-diagnostic-heading > span {
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.ws-v6-diagnostics .v6-diagnostic-entity { color: #93a7b9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.ws-v6-diagnostics .v6-diagnostic-explanation { color: #f0d9d5; }
.ws-v6-diagnostics .v6-diagnostic-section-title { display: block; margin-top: 9px; color: #dce7ef; font-size: 10px; }
.ws-v6-diagnostics .v6-diagnostic-inputs > span {
  max-width: 100%;
  padding: 3px 5px;
  border: 1px solid #405466;
  border-radius: 3px;
  background: #15212b;
  color: #c4d1dc;
  overflow-wrap: anywhere;
}
.ws-v6-diagnostics .v6-diagnostic ol { margin: 5px 0 0; padding-left: 18px; color: #cad7e0; }
.ws-v6-diagnostics .v6-diagnostic li + li { margin-top: 3px; }
.ws-v6-diagnostics .v6-diagnostic details { margin-top: 8px; color: #aebdca; }
.ws-v6-diagnostics .v6-diagnostic details p { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.ws-v6-diagnostics .v6-diagnostic-actions { margin-top: 9px; }
.ws-v6-diagnostics .v6-diagnostic-actions button {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #4c6275;
  border-radius: 3px;
  background: #1b2b38;
  color: #d9e7f1;
  font: 700 9px/1 system-ui, sans-serif;
}
.ws-panel-cap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--v3-line-soft);
  background: #111b25;
}
.ws-panel-cap span {
  color: #91a4b7;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em;
}
.ws-panel-cap small {
  color: #53697d;
  font-size: 8.5px;
}
.ws-tree-document {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--v3-line-soft);
  background: #192735;
}
.ws-tree-icon,
.ws-tree-icon .ws-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #83bbf3;
}
.ws-tree-document > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ws-tree-document b {
  color: #e4edf5;
  font-size: 11px;
}
.ws-tree-document small {
  color: #71859a;
  font-size: 9px;
}
.ws-origin {
  border-bottom: 1px solid var(--v3-line-soft);
  background: #15212d;
}
.ws-origin summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: #9aabba;
  font-size: 10px;
  cursor: pointer;
  list-style: none;
}
.ws-origin summary::-webkit-details-marker {
  display: none;
}
.ws-origin summary span::before {
  content: '›';
  display: inline-block;
  margin-right: 7px;
  color: #5d7185;
  transform: rotate(90deg);
}
.ws-origin:not([open]) summary span::before {
  transform: rotate(0);
}
.ws-origin summary small {
  color: #52677a;
  font-size: 8.5px;
}
.ws-origin button {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px 0 26px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.025);
  background: transparent;
  color: #9dafc0;
  font: inherit;
  font-size: 10.5px;
  text-align: left;
  cursor: pointer;
}

.datum-tree {
  display: grid;
  gap: 2px;
  padding: 2px 6px 7px 18px;
}
.datum-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #bccbda;
}
.datum-row > button {
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.datum-row small {
  color: #7890a7;
  font-size: 9px;
  text-transform: uppercase;
}
.datum-row[data-broken='true'] {
  border-color: #9a514d;
  color: #ffb4a9;
}
.datum-row [data-datum-action='edit'] {
  width: 28px;
  text-align: center;
}
.datum-row[data-broken='true'] [data-datum-action='edit'] {
  width: auto;
  min-height: 28px;
  padding: 0 7px;
  color: #ffcbc5;
  font-size: 9px;
  text-transform: uppercase;
}
.pattern-row { grid-template-columns: 1fr 28px 28px; }
.pattern-row > button:not(:first-child) {
  width: 28px;
  min-height: 28px;
  padding: 0;
  text-align: center;
}
.pattern-instance-row {
  display: grid;
  grid-template-columns: 1fr 28px 42px;
  align-items: center;
  min-height: 27px;
  margin-left: 14px;
  border-left: 1px solid #31485e;
  color: #91a9bf;
}
.pattern-instance-row.is-selected { color: #d8ecff; background: rgba(82, 118, 155, .18); }
.pattern-instance-row button {
  min-width: 0;
  min-height: 27px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}
.pattern-instance-row button:last-child { color: #7890a7; text-align: center; }
.pattern-instance-row label { display: grid; place-items: center; min-height: 27px; }
.assembly-row,
.mate-row {
  display: grid;
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #b8c9d9;
}
.assembly-row { grid-template-columns: 18px minmax(0, 1fr) 28px 28px; }
.mate-row { grid-template-columns: minmax(0, 1fr) 28px 28px; }
.assembly-row.is-selected,
.assembly-leaf-row.is-selected,
.mate-row.is-selected { color: #d8ecff; background: rgba(82, 118, 155, .18); }
.assembly-row.is-suppressed,
.mate-row.is-suppressed { opacity: .55; }
.mate-row.is-failed { border-color: #9a514d; color: #ffb4a9; }
.assembly-row button,
.mate-row button,
.assembly-leaf-row button {
  min-width: 0;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}
.assembly-row > button:not(:first-child),
.mate-row > button:not(:first-child) { padding: 0; text-align: center; }
.assembly-row span,
.mate-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assembly-row small,
.mate-row small,
.assembly-pattern-row small { display: block; color: #7890a7; font-size: 9px; text-transform: uppercase; }
.assembly-leaf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  min-height: 27px;
  margin-left: 14px;
  border-left: 1px solid #31485e;
  color: #91a9bf;
}
.assembly-leaf-row label { display: grid; place-items: center; min-height: 27px; }
.assembly-pattern-row { min-height: 30px; padding: 4px 6px; border-top: 1px solid rgba(255,255,255,.035); color: #a8bdd0; font-size: 10px; }
.inspection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  min-height: 30px;
  color: #adc0d1;
  border-left: 2px solid transparent;
}
.inspection-row.stage-group-row { grid-template-columns: minmax(0, 1fr) 28px 28px; }
.inspection-row.is-active { color: #d9edff; background: rgba(74, 127, 166, .17); border-left-color: #67b7f0; }
.inspection-row button {
  min-width: 0;
  min-height: 28px;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}
.inspection-row > button:not(:first-child) { padding: 0; text-align: center; }
.inspection-row span,
.inspection-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspection-row small,
.stage-leaf-row small { color: #7890a7; font-size: 9px; text-transform: uppercase; }
.stage-leaf-row { padding: 3px 6px 3px 12px; grid-template-columns: minmax(0, 1fr) auto; font-size: 10px; }
.inspection-results { max-height: 190px; overflow: auto; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
@media (max-width: 760px) {
  .pattern-row { grid-template-columns: minmax(0, 1fr) 44px 44px; min-height: 44px; }
  .pattern-row > button:first-child,
  .pattern-row > button:not(:first-child),
  .pattern-instance-row button,
  .pattern-instance-row label { min-width: 44px; min-height: 44px; }
  .pattern-instance-row { grid-template-columns: minmax(0, 1fr) 44px 52px; min-height: 44px; }
  .assembly-row,
  .mate-row { min-height: 44px; }
  .assembly-row { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; }
  .mate-row { grid-template-columns: minmax(0, 1fr) 44px 44px; }
  .assembly-leaf-row { grid-template-columns: minmax(0, 1fr) 44px; min-height: 44px; }
  .assembly-row button,
  .mate-row button,
  .assembly-leaf-row button,
  .assembly-leaf-row label { min-width: 44px; min-height: 44px; }
  .inspection-row { grid-template-columns: minmax(0, 1fr) 44px; min-height: 44px; }
  .inspection-row.stage-group-row { grid-template-columns: minmax(0, 1fr) 44px 44px; }
  .inspection-row button { min-width: 44px; min-height: 44px; }
}

.ws-v5-command {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #52769b;
  border-radius: 5px;
  background: #1b2937;
  color: #d7e1eb;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .55);
}
.ws-v5-command::backdrop { background: rgba(6, 12, 18, .68); }
.ws-v5-command form > header,
.ws-v5-command form > footer { padding: 14px 16px; background: #15212d; }
.ws-v5-command form > header span { color: #8fc1f5; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.ws-v5-command h2 { margin: 3px 0 0; font-size: 18px; }
.ws-v5-command-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 16px; }
.ws-v5-command-fields label { display: grid; gap: 5px; color: #a9bacb; font-size: 11px; }
.ws-v5-command-fields .is-wide { grid-column: 1 / -1; }
.ws-v5-command-fields p { margin: 0; color: #8fa6bb; font-size: 11px; }
.ws-v5-command-fields input,
.ws-v5-command-fields select,
.ws-v5-command-fields textarea { min-height: 34px; border: 1px solid #3a5470; border-radius: 3px; background: #111b26; color: #eef5fc; padding: 5px 8px; font: inherit; }
.ws-v5-command-fields textarea { min-height: 132px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.45; }
.ws-v5-command-fields select[multiple] { min-height: 112px; }
.ws-v6-command-preview {
  margin: 0 16px 12px;
  padding: 12px;
  border: 1px solid rgba(83, 169, 236, .48);
  border-radius: 4px;
  background: rgba(14, 34, 51, .88);
  box-shadow: inset 3px 0 0 #2c91df;
}
.ws-v6-command-preview[hidden] { display: none; }
.ws-v6-command-preview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ws-v6-command-preview span {
  color: #73baf0;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .11em;
}
.ws-v6-command-preview b { color: #e6f3ff; font-size: 12px; }
.ws-v6-command-preview p { margin: 8px 0; color: #b8cadb; font-size: 11px; line-height: 1.45; }
.ws-v6-command-preview dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
  color: #91a9be;
  font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-v6-command-preview dt { color: #6f8aa2; }
.ws-v6-command-preview dd { margin: 0; color: #c9d9e7; overflow-wrap: anywhere; }
.ws-v5-command-error { min-height: 18px; margin: 0; padding: 0 16px 10px; color: #ffb4a9; font-size: 11px; }
.ws-v5-command footer { display: flex; justify-content: flex-end; gap: 8px; }
.ws-v5-command footer button { min-height: 34px; padding: 0 15px; border: 1px solid #3a5470; border-radius: 3px; background: #22303f; color: #d7e1eb; cursor: pointer; }
.ws-v5-command footer .ws-primary { background: #0b5cad; border-color: #0b5cad; color: #fff; }
.ws-direct-edit footer .is-danger { margin-right: auto; border-color: #7e4a48; color: #ffbbb4; }

.ws-sketch-reuse {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid #52769b;
  border-radius: 5px;
  background: #172431;
  color: #d7e1eb;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .62);
}
.ws-sketch-reuse::backdrop { background: rgba(6, 12, 18, .74); }
.ws-sketch-reuse-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  max-height: calc(100dvh - 30px);
}
.ws-sketch-reuse-shell > header,
.ws-sketch-reuse-shell > footer {
  padding: 14px 16px;
  background: #111d28;
}
.ws-sketch-reuse-shell > header span {
  color: #8fc1f5;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ws-sketch-reuse-shell h2 { margin: 3px 0 0; font-size: 18px; }
.ws-sketch-reuse-shell header p { margin: 5px 0 0; color: #8fa6bb; font-size: 11px; }
.ws-sketch-reuse-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #2d4053;
  background: #1b2a38;
}
.ws-sketch-reuse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  padding: 14px 16px;
  overflow: auto;
}
.ws-sketch-reuse-grid fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #31485e;
  border-radius: 4px;
  background: #1a2937;
}
.ws-sketch-reuse-grid legend {
  padding: 0 5px;
  color: #c9e6fb;
  font-size: 11px;
  font-weight: 700;
}
.ws-sketch-reuse label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #a9bacb;
  font-size: 11px;
}
.ws-sketch-reuse .is-wide { grid-column: 1 / -1; }
.ws-sketch-reuse input,
.ws-sketch-reuse select,
.ws-sketch-reuse textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  border: 1px solid #3a5470;
  border-radius: 3px;
  background: #111b26;
  color: #eef5fc;
  padding: 5px 8px;
  font: inherit;
}
.ws-sketch-reuse textarea {
  min-height: 124px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.45;
}
.ws-sketch-reuse-grid fieldset > p {
  margin: 0;
  color: #8299ad;
  font-size: 10px;
  line-height: 1.45;
}
.ws-sketch-reuse-grid fieldset > p code { color: #b9d7ef; }
.ws-sketch-reuse input[readonly] { color: #8fc1f5; background: #13212e; }
.ws-sketch-reuse select[multiple] { min-height: 116px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ws-sketch-reuse-check {
  grid-column: 1 / -1;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  justify-content: start;
}
.ws-sketch-reuse-check input { width: 16px; min-height: 16px; margin: 0; }
.ws-sketch-reuse-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}
.ws-sketch-reuse button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #3f6384;
  border-radius: 3px;
  background: #21384c;
  color: #e2edf7;
  cursor: pointer;
}
.ws-sketch-reuse button:hover:not(:disabled) { border-color: #69a9df; background: #274963; }
.ws-sketch-reuse button:disabled { opacity: .42; cursor: not-allowed; }
.ws-sketch-reuse button.is-danger { border-color: #704a4a; color: #ffc0b9; }
.ws-sketch-reuse-error { min-height: 18px; margin: 0; padding: 0 16px 10px; color: #ffb4a9; font-size: 11px; }
.ws-sketch-reuse-shell > footer { display: flex; justify-content: flex-end; }
.datum-row [data-sketch-action='edit'] { width: 28px; text-align: center; }

@media (max-width: 760px) {
  .ws-sketch-reuse { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .ws-sketch-reuse-shell { max-height: 100dvh; }
  .ws-sketch-reuse-target,
  .ws-sketch-reuse-grid { grid-template-columns: 1fr; }
}

/* Part configurations use the language of a compact engineering table: the
 * active row is a blue datum rail, IDs stay monospace, and edits remain quiet
 * until the user commits one validated document transaction. */
.cadstudio-app .ws-app-actions .ws-configurations-open {
  min-width: 82px !important;
  gap: 5px;
  color: #c9e6fb;
}
.ws-configurations-open small {
  max-width: 84px;
  overflow: hidden;
  color: #8fc1f5;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-configurations-open[aria-disabled='true'],
[data-command-target='bw-configurations-open'][aria-disabled='true'] {
  opacity: .48;
  cursor: not-allowed;
}
.ws-configurations {
  width: min(1080px, calc(100vw - 28px));
  height: min(780px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid #52769b;
  border-radius: 5px;
  background: #172431;
  color: #d7e1eb;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .62);
}
.ws-configurations::backdrop { background: rgba(4, 10, 16, .8); }
.ws-configurations-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}
.ws-configurations-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto) 34px;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid #3b5267;
  background: #111c27;
}
.ws-configurations-head > div:first-child > span,
.ws-config-detail-head > div > span {
  color: #7eb8e7;
  font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.ws-configurations-head h2 {
  margin: 3px 0 0;
  color: #f0f6fb;
  font-size: 20px;
  line-height: 1.1;
}
.ws-configurations-head p {
  margin: 5px 0 0;
  color: #8fa5b8;
  font-size: 11px;
}
.ws-configurations-active {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  min-width: 0;
  padding: 9px 11px;
  border-left: 3px solid #4da5e4;
  background: #172a3b;
}
.ws-configurations-active small {
  grid-row: 1 / 3;
  align-self: center;
  color: #65b5ef;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.ws-configurations-active strong {
  overflow: hidden;
  color: #e5f3fd;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-configurations-active code,
.ws-config-detail-head code {
  overflow: hidden;
  color: #7f9ab1;
  font: 9px/1.25 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-configurations-close,
.ws-config-icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #9eb0c1;
  font: 20px/1 system-ui, sans-serif;
  cursor: pointer;
}
.ws-configurations-close:hover,
.ws-config-icon-button:hover { border-color: #48647d; background: #213243; color: #fff; }
.ws-config-workbench {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 0;
}
.ws-config-unavailable {
  align-self: center;
  justify-self: center;
  width: min(480px, calc(100% - 40px));
  padding: 28px;
  border: 1px solid #3b5267;
  border-left: 3px solid #d69d42;
  background: #12202c;
}
.ws-config-unavailable b { color: #f1f5f9; font-size: 15px; }
.ws-config-unavailable p { margin: 8px 0 0; color: #97aabd; font-size: 12px; line-height: 1.55; }
.ws-config-list-panel {
  min-width: 0;
  min-height: 0;
  padding: 0 8px 10px;
  overflow: auto;
  border-right: 1px solid #354b5f;
  background: #131f2a;
}
.ws-config-panel-head,
.ws-config-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ws-config-panel-head {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 50px;
  margin: 0 -8px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid #304456;
  background: #131f2a;
}
.ws-config-panel-head span,
.ws-config-section-head > span { display: grid; gap: 3px; min-width: 0; }
.ws-config-panel-head b,
.ws-config-section-head b { color: #dce8f2; font-size: 11px; }
.ws-config-panel-head small,
.ws-config-section-head small { color: #788ea2; font-size: 9px; line-height: 1.35; }
.ws-config-list { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.ws-config-list button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  width: 100%;
  min-height: 46px;
  padding: 7px 8px 7px 11px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #afc0d0;
  text-align: left;
  cursor: pointer;
}
.ws-config-list button::before {
  position: absolute;
  inset: 4px auto 4px 0;
  width: 2px;
  background: transparent;
  content: '';
}
.ws-config-list button:hover { border-color: #344c61; background: #192a38; }
.ws-config-list button[aria-selected='true'] { border-color: #456782; background: #1b3041; color: #edf7ff; }
.ws-config-list button[aria-current='true']::before { background: #55abe7; }
.ws-config-list button b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ws-config-list button code { grid-column: 1 / -1; overflow: hidden; color: #71899d; font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.ws-config-active-tag { color: #68baf2; font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
.ws-config-empty,
.ws-config-detail-empty {
  margin: 12px;
  color: #788fa3;
  font-size: 10px;
  line-height: 1.5;
}
.ws-config-editor {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) minmax(190px, .62fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.ws-config-detail { min-height: 0; overflow: auto; }
.ws-config-detail-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 61px;
  padding: 9px 16px;
  border-bottom: 1px solid #354b5f;
  background: #172431;
}
.ws-config-detail-head h3 { margin: 4px 0 2px; color: #edf5fb; font-size: 15px; }
.ws-config-row-actions,
.ws-config-section-head > div,
.ws-config-save-row { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.ws-config-row-actions button,
.ws-config-section-head button,
.ws-config-save-row button,
.ws-configurations-foot > button {
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid #3b5871;
  border-radius: 3px;
  background: #213140;
  color: #ccd9e4;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.ws-config-row-actions button:hover,
.ws-config-section-head button:hover,
.ws-config-save-row button:hover,
.ws-configurations-foot > button:hover { border-color: #5b7d9a; color: #fff; }
.ws-config-row-actions button:disabled,
.ws-config-section-head button:disabled { opacity: .42; cursor: default; }
.ws-config-row-actions .ws-config-delete { border-color: #694c4d; color: #f1b1ac; }
.ws-config-row-actions .ws-config-delete.is-armed { border-color: #b66861; background: #5a2927; color: #fff; }
.ws-config-section-head .ws-primary,
.ws-config-save-row .ws-primary { border-color: #0c69bb; background: #0c61aa; color: #fff; }
.ws-config-detail-body { display: grid; gap: 12px; padding: 14px 16px 18px; }
.ws-config-name-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #9db0c2;
  font-size: 10px;
}
.ws-config-name-field input,
.ws-config-override-row input[type='text'],
.ws-config-feature-row select,
.ws-config-design-table textarea {
  border: 1px solid #3b5871;
  border-radius: 3px;
  background: #101b25;
  color: #e6eff7;
  font: inherit;
}
.ws-config-name-field input,
.ws-config-override-row input[type='text'],
.ws-config-feature-row select { min-height: 32px; padding: 4px 8px; }
.ws-config-overrides { border: 1px solid #304659; background: #14212c; }
.ws-config-overrides > .ws-config-section-head { min-height: 42px; padding: 6px 10px; border-bottom: 1px solid #2b4052; }
.ws-config-override-list,
.ws-config-feature-list { display: grid; }
.ws-config-override-row,
.ws-config-feature-row {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(190px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 9px;
  border-top: 1px solid rgba(255, 255, 255, .045);
}
.ws-config-override-row:first-child,
.ws-config-feature-row:first-child { border-top: 0; }
.ws-config-override-identity { display: grid; gap: 2px; min-width: 0; }
.ws-config-override-identity b { overflow: hidden; color: #c6d5e2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ws-config-override-identity small { overflow: hidden; color: #71899d; font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.ws-config-override-toggle { display: inline-flex; align-items: center; gap: 6px; color: #8fa5b7; font-size: 9px; white-space: nowrap; }
.ws-config-override-toggle input { accent-color: #4ca4e2; }
.ws-config-override-row input[type='text']:disabled { opacity: .5; }
.ws-config-state {
  min-width: 68px;
  padding: 4px 6px;
  border: 1px solid #40566a;
  border-radius: 2px;
  color: #94a8ba;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  text-transform: uppercase;
}
.ws-config-state[data-state='suppressed'] { border-color: #73504d; color: #e7a59e; }
.ws-config-state[data-state='included'] { border-color: #3f6659; color: #8fd6b5; }
.ws-config-save-row { padding-top: 2px; }
.ws-config-design-table {
  display: grid;
  grid-template-rows: auto minmax(90px, 1fr) auto;
  min-height: 0;
  padding: 12px 16px 10px;
  border-top: 1px solid #48647b;
  background: #111d28;
}
.ws-config-design-table .ws-config-section-head { margin-bottom: 9px; }
.ws-config-design-table textarea {
  width: 100%;
  min-height: 0;
  padding: 9px 10px;
  resize: none;
  font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  tab-size: 2;
}
.ws-config-design-table textarea[data-dirty='true'] { border-color: #b17d35; box-shadow: inset 3px 0 0 #b17d35; }
.ws-config-design-table > p { margin: 7px 0 0; color: #71899d; font-size: 9px; }
.ws-configurations-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 47px;
  padding: 6px 12px 6px 16px;
  border-top: 1px solid #3a5064;
  background: #121e29;
}
.ws-config-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  min-width: 0;
  margin-right: auto;
  color: #9eb2c3;
  font-size: 10px;
}
.ws-config-status[hidden] { display: none; }
.ws-config-status strong {
  grid-row: 1 / 3;
  align-self: center;
  padding: 3px 5px;
  border: 1px solid #3a6b5b;
  border-radius: 2px;
  color: #88d5b2;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-config-status small { grid-column: 2; color: #71899d; font-size: 8px; }
.ws-config-status[data-state='error'] { color: #ffc2bc; }
.ws-config-status[data-state='error'] strong { border-color: #86504d; color: #ff9d94; }
.ws-configurations button:focus-visible,
.ws-configurations input:focus-visible,
.ws-configurations select:focus-visible,
.ws-configurations textarea:focus-visible {
  outline: 2px solid #69bdf5;
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .cadstudio-app .ws-app-actions .ws-configurations-open { min-width: 36px !important; }
  .ws-configurations-open small { display: none; }
  .ws-configurations { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .ws-configurations-head { grid-template-columns: minmax(0, 1fr) 34px; min-height: 72px; gap: 8px; padding-left: 13px; }
  .ws-configurations-head p,
  .ws-configurations-active { display: none; }
  .ws-config-workbench { grid-template-columns: 1fr; overflow: auto; }
  .ws-config-list-panel { max-height: 190px; border-right: 0; border-bottom: 1px solid #354b5f; }
  .ws-config-editor { display: block; overflow: visible; }
  .ws-config-detail { overflow: visible; }
  .ws-config-detail-head { position: static; }
  .ws-config-detail-body { padding: 12px; }
  .ws-config-name-field { grid-template-columns: 1fr; }
  .ws-config-override-row,
  .ws-config-feature-row { grid-template-columns: minmax(110px, 1fr) minmax(130px, 1fr); }
  .ws-config-override-row .ws-config-state,
  .ws-config-feature-row .ws-config-state { grid-column: 1 / -1; justify-self: start; }
  .ws-config-design-table { min-height: 300px; padding: 12px; }
  .ws-config-design-table .ws-config-section-head { align-items: flex-start; flex-direction: column; }
  .ws-config-design-table textarea { min-height: 170px; }
}
.ws-v5-command.with-gizmo,
.ws-v5-command.with-viewport-pick {
  position: fixed;
  inset: auto 18px 52px auto;
  width: min(430px, calc(100vw - 36px));
  max-height: min(70vh, 620px);
  margin: 0;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .46);
}
.ws-v5-command.with-gizmo::backdrop,
.ws-v5-command.with-viewport-pick::backdrop { background: transparent; }
.ws-origin button:hover {
  background: #1b2c3b;
  color: #e2edf7;
}
.ws-origin kbd {
  color: #60768a;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cadstudio-app .wsp {
  background: transparent;
}
.cadstudio-app .wsp-head {
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--v3-line-soft);
  color: #879aac;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.cadstudio-app .wsp-head > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cadstudio-app .wsp-head small {
  color: #53697c;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
.ws-tree-rule {
  flex: 1;
  height: 1px;
  margin-left: 8px;
  background: var(--v3-line-soft);
}
.cadstudio-app .wsp-body {
  padding: 7px 8px 10px;
}
.cadstudio-app .hist {
  gap: 2px;
}
.cadstudio-app .hist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 4px 6px;
  border-color: transparent;
  border-radius: 3px;
  background: transparent;
}
.cadstudio-app .hist-item:hover {
  background: #1c2d3d;
}
.cadstudio-app .hist-item.sel {
  border-color: #3e87cf;
  background: #193553;
  box-shadow: 3px 0 0 var(--v3-blue) inset;
}
.cadstudio-app .hist-item.err {
  border-color: #b44d4d;
  background: #38232a;
}
.cadstudio-app .hist-item .hi-sel {
  display: grid;
  grid-template-columns: 27px 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  min-width: 0;
  margin: 0;
}
.hi-glyph {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #385069;
  border-radius: 2px;
  background: #12202c;
  color: #8ebeea;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cadstudio-app .hist-item .hi-n {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cadstudio-app .hist-item .hi-d {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  margin: 1px 0 0;
  color: #697e92;
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cadstudio-app .hist-item.sel .hi-n::before {
  content: '';
}
.cadstudio-app .hist-item .hi-a {
  display: flex;
  min-width: 0;
}
.cadstudio-app .hist-item:not(.sel) .hi-a button:not([data-edit]) {
  display: none;
}
.cadstudio-app .hist-item.sel {
  grid-template-columns: minmax(0, 1fr);
}
.cadstudio-app .hist-item.sel .hi-sel,
.cadstudio-app .hist-item.sel .hi-a {
  grid-column: 1 / -1;
}
.cadstudio-app .hist-item.sel .hi-a {
  justify-content: flex-end;
  margin-top: 4px;
}
.cadstudio-app .hist-item .hi-a button {
  min-width: 27px;
  min-height: 27px;
  margin: 0 0 0 3px;
  padding: 0 6px;
  border-color: #31485f;
  background: #182735;
  font-size: 9px;
}
.cadstudio-app .v6-revision-list {
  display: grid;
  gap: 2px;
  margin: 0 0 6px;
  padding: 0 0 6px;
  border-bottom: 1px solid #273b4e;
  list-style: none;
}
.cadstudio-app .v6-revision-item {
  display: grid;
  grid-template-columns: 27px 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  align-items: center;
  min-height: 40px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: default;
  background: #10202d;
}
.cadstudio-app .v6-revision-item .hi-glyph {
  grid-column: 1;
  grid-row: 1 / 3;
}
.cadstudio-app .v6-revision-item .hi-n {
  grid-column: 2;
  grid-row: 1;
}
.cadstudio-app .v6-revision-item small {
  grid-column: 2;
  grid-row: 2;
  color: #697e92;
  font-size: 8.5px;
}
.cadstudio-app .v6-revision-item[aria-current='true'] {
  border-left-color: #3e87cf;
}
.ws-inspector-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin: 12px;
  padding: 16px 14px;
  border: 1px dashed #31475a;
  background: rgba(12, 20, 28, 0.28);
}
.ws-inspector-empty-icon,
.ws-inspector-empty-icon .ws-icon {
  width: 24px;
  height: 24px;
  color: #617d98;
}
.ws-inspector-empty b {
  color: #b7c6d4;
  font-size: 11px;
}
.ws-inspector-empty p {
  margin: 0;
  color: #63788c;
  font-size: 9.5px;
  line-height: 1.45;
}
.ws-selection-live {
  padding: 2px 5px;
  border: 1px solid rgba(47,140,255,.35);
  background: rgba(47,140,255,.08);
  color: #74b4f5;
  font: 700 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
}
.cadstudio-app #bw-context input[type='text'],
.cadstudio-app .param-row input {
  border-color: #344b61;
  background: #101b25;
  border-radius: 2px;
}

/* canvas instrumentation */
.cadstudio-app #bw-studio {
  background:
    radial-gradient(circle at 50% 44%, rgba(46, 67, 87, 0.23), transparent 42%),
    linear-gradient(180deg, #17232f 0%, #111b25 100%);
  box-shadow: 0 0 0 1px #0a1016 inset;
}
.cadstudio-app .mode-label {
  top: 12px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(89, 121, 150, 0.34);
  border-radius: 3px;
  background: rgba(10, 18, 26, 0.84);
  box-shadow: 0 7px 20px rgba(0,0,0,.18);
  color: #c6d4e1;
  font: 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  backdrop-filter: blur(8px);
}
.cadstudio-app .mode-label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--v3-blue);
  box-shadow: 0 0 9px rgba(47,140,255,.75);
}
.ws-edit-context-banner {
  position: absolute;
  top: 52px;
  left: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 6px 7px 6px 11px;
  border: 1px solid rgba(103, 183, 240, .58);
  border-left: 3px solid #67b7f0;
  border-radius: 3px;
  background: rgba(12, 27, 39, .93);
  box-shadow: 0 9px 24px rgba(0, 0, 0, .28);
  color: #dceaf5;
  backdrop-filter: blur(8px);
}
.ws-edit-context-banner[hidden] { display: none; }
.ws-edit-context-banner span { display: grid; gap: 2px; }
.ws-edit-context-banner b { font-size: 10px; }
.ws-edit-context-banner small { color: #8fa9bd; font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ws-edit-context-banner button {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #456a88;
  border-radius: 2px;
  background: #1b3850;
  color: #d7eaf9;
  font: 700 9px/1 system-ui, sans-serif;
  cursor: pointer;
}
.ws-edit-context-banner button:hover { background: #244b69; }
.ws-viewcube {
  position: absolute;
  top: 13px;
  right: 14px;
  z-index: 5;
  width: 110px;
  height: 104px;
  filter: drop-shadow(0 9px 12px rgba(0,0,0,.25));
}
.ws-viewcube-shape {
  position: relative;
  width: 110px;
  height: 80px;
}
.vc-face {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #4a6177;
  color: #9db2c5;
  font: 700 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  cursor: pointer;
}
.vc-face:hover,
.vc-face.on,
.vc-face[aria-pressed='true'] {
  color: #fff;
  border-color: #72b6f5;
  background-color: #246fad !important;
}
.vc-top {
  top: 0;
  left: 28px;
  width: 56px;
  height: 42px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: #25384a;
}
.vc-front {
  top: 31px;
  left: 0;
  width: 56px;
  height: 43px;
  clip-path: polygon(0 0, 100% 25%, 100% 100%, 0 74%);
  background: #1c2c3a;
}
.vc-right {
  top: 31px;
  right: 0;
  width: 56px;
  height: 43px;
  clip-path: polygon(0 25%, 100% 0, 100% 74%, 0 100%);
  background: #213344;
}
.vc-iso {
  position: absolute;
  right: 3px;
  bottom: 0;
  min-width: 34px;
  min-height: 22px;
  border: 1px solid #3b5268;
  border-radius: 2px;
  background: rgba(12, 21, 29, .84);
  color: #7991a7;
  font: 700 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}
.vc-iso:hover,
.vc-iso.on,
.vc-iso[aria-pressed='true'] {
  border-color: #5ca7ed;
  color: #ddecfa;
  background: #194d7d;
}
.ws-nav-rail {
  position: absolute;
  right: 17px;
  top: 126px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  border: 1px solid #2d4357;
  border-radius: 3px;
  background: rgba(10, 18, 26, .82);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
  backdrop-filter: blur(8px);
}
.ws-nav-rail button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #2b3d4e;
  background: transparent;
  color: #7991a7;
  cursor: pointer;
}
.ws-nav-rail button:last-child {
  border-bottom: 0;
}
.ws-nav-rail button:hover,
.ws-nav-rail button[aria-pressed='true'] {
  background: #1e3447;
  color: #9dd0ff;
}
.ws-nav-rail button span:last-child {
  display: none;
}
.ws-selection-tools {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  transform: translateX(-50%);
  border: 1px solid #2d4357;
  border-radius: 3px;
  background: rgba(10, 18, 26, .88);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
  backdrop-filter: blur(8px);
  color: #9eb0c0;
  font: 600 10px/1.2 ui-sans-serif, system-ui, sans-serif;
}
.ws-selection-tools label { display: flex; align-items: center; gap: 5px; }
/* The floating 3D selection bar has no role while the 2D sketch editor owns
   the viewport, and on short viewports it overlaps the sketch action strip. */
.cadstudio-app[data-mode='sketching'] .ws-selection-tools { display: none; }
.ws-selection-tools select,
.ws-selection-tools button {
  min-height: 28px;
  border: 1px solid #3b5268;
  border-radius: 2px;
  background: #152738;
  color: #d8e6f3;
  font: inherit;
}
.ws-selection-tools button { padding: 0 9px; cursor: pointer; }
.ws-selection-tools button:hover,
.ws-selection-tools button[aria-pressed='true'] { border-color: #5ca7ed; background: #194d7d; }
.ws-selection-tools button:disabled { opacity: .42; cursor: default; }
#bw-selection-marquee {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  border: 1px solid #65b7ff;
  background: rgba(46, 168, 255, .12);
}
#bw-selection-marquee[data-mode='crossing'] {
  border-style: dashed;
  border-color: #55d797;
  background: rgba(85, 215, 151, .12);
}
.ws-context-toolbar {
  position: absolute;
  z-index: 30;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid #4b6e8c;
  border-radius: 3px;
  background: rgba(15, 29, 41, .97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .42);
  backdrop-filter: blur(8px);
}
.ws-context-toolbar[hidden] { display: none; }
.ws-context-toolbar button {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #d6e4ef;
  font: 700 9px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}
.ws-context-toolbar button:hover,
.ws-context-toolbar button:focus-visible {
  border-color: #5ca7ed;
  outline: 0;
  background: #194d7d;
}
.ws-mouse-gesture {
  position: absolute;
  z-index: 31;
  width: 164px;
  height: 164px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(107, 166, 216, .72);
  border-radius: 50%;
  background: rgba(8, 17, 25, .9);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .48);
  pointer-events: none;
}
.ws-mouse-gesture[hidden] { display: none; }
.ws-mouse-gesture span {
  position: absolute;
  display: grid;
  min-width: 58px;
  min-height: 26px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid #365976;
  border-radius: 3px;
  background: #142b3e;
  color: #a9c0d3;
  font: 700 8px/1 ui-sans-serif, system-ui, sans-serif;
}
.ws-mouse-gesture span.is-active {
  border-color: #76bbf5;
  background: #1768a8;
  color: #fff;
}
.ws-mouse-gesture [data-gesture-direction='north'] { top: 8px; left: 50%; transform: translateX(-50%); }
.ws-mouse-gesture [data-gesture-direction='east'] { right: 5px; top: 50%; transform: translateY(-50%); }
.ws-mouse-gesture [data-gesture-direction='south'] { bottom: 8px; left: 50%; transform: translateX(-50%); }
.ws-mouse-gesture [data-gesture-direction='west'] { left: 5px; top: 50%; transform: translateY(-50%); }
.ws-mouse-gesture i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid #78b8ef;
  border-radius: 50%;
  background: #17334a;
}
.ws-hud-icon,
.ws-hud-icon .ws-icon {
  width: 18px;
  height: 18px;
}
.ws-axis-triad {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 3;
  width: 74px;
  height: 67px;
  color: #93a6b8;
  font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  pointer-events: none;
}
.ws-axis-triad i,
.ws-axis-triad::before,
.ws-axis-triad::after {
  content: '';
  position: absolute;
  left: 34px;
  bottom: 16px;
  width: 31px;
  height: 2px;
  transform-origin: left center;
}
.ws-axis-triad::before {
  background: #ef6464;
  transform: rotate(-18deg);
}
.ws-axis-triad::after {
  background: #65c98a;
  transform: rotate(202deg);
}
.ws-axis-triad i {
  width: 2px;
  height: 36px;
  background: #5d9cf5;
  transform: none;
}
.ws-axis-triad span {
  position: absolute;
}
.axis-x { right: 0; bottom: 2px; color: #ff8585; }
.axis-y { left: 0; bottom: 8px; color: #7fdda1; }
.axis-z { left: 31px; top: 0; color: #80b4ff; }
/* Picker panels (fillet/chamfer edge pick, face pick, shell pick) dock to
   the right stage edge, below the view cube and beside the navigation rail,
   so they never cover the viewport centre, and carry a sane minimum width so
   their controls cannot collapse into a one-word-per-line column. */
.cadstudio-app .pick-bar {
  top: 126px;
  left: auto;
  right: 64px;
  min-width: min(320px, calc(100% - 110px));
  max-width: min(430px, calc(100% - 110px));
  transform: none;
  border-color: #49647d;
  border-radius: 3px;
  background: rgba(16, 29, 41, .95);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}

/* command surface and machine status */
.cadstudio-app .ws-cmd {
  min-height: 34px;
  padding: 4px 10px;
  gap: 8px;
  border-top-color: #070c11;
  background: #0d151e;
  color: #aebfd0;
  font-size: 10.5px;
}
.ws-command-prompt {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #31506d;
  color: #77b9f7;
  font-size: 14px;
}
.ws-command-help {
  margin-left: auto;
  color: #52677a;
  font-size: 8.5px;
}
.cadstudio-app .ws-cmd-actions {
  margin-left: 6px;
}
.cadstudio-app .ws-status {
  min-height: 25px;
  gap: 14px;
  padding: 0 10px;
  border-top: 1px solid #1c4f82;
  background: #133f6b;
  color: #bdd8f0;
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-status-mode {
  padding-right: 11px;
  border-right: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-weight: 700;
  letter-spacing: .08em;
}
.ws-kernel-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a8cae7;
}

@media (max-width: 1080px) {
  .ws-tree { flex-basis: 210px; }
  .cadstudio-app .ws-side { flex-basis: 250px; }
  .cadstudio-app .wsr-btn { min-width: 112px; }
  .ws-document { min-width: 210px; }
  .ws-export-btn span:first-child { display: none; }
}

@media (max-width: 760px) {
  .cadstudio-app .ws-appbar {
    grid-template-columns: auto 1fr auto;
    min-height: 48px;
    gap: 7px;
  }
  .ws-brand > span:last-child,
  .ws-document-kind,
  .ws-document .ws-local {
    display: none;
  }
  .ws-document {
    min-width: 0;
    height: 34px;
  }
  .ws-document .ws-project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ws-edit-actions,
  .ws-file-actions {
    display: none;
  }
  .cadstudio-app .ws-app-actions .ws-quick-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .cadstudio-app.m-open-project .ws-file-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bw-sheet-bottom, 0px);
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 12px 12px 14px;
    border: 0;
    border-top: 1px solid #405b72;
    background: #172634;
    box-shadow: 0 -10px 28px rgba(0,0,0,.42);
  }
  .cadstudio-app.m-open-project .ws-file-actions .ws-quick-btn {
    flex-direction: column;
    gap: 6px;
    min-height: 48px;
    border-color: #365069;
    background: #1d3041;
    color: #c9d8e6;
    font-size: 10px;
  }
  .cadstudio-app.m-open-project .ws-file-actions .ws-quick-btn > span {
    display: inline !important;
  }
  .cadstudio-app.m-open-project .ws-file-actions .ws-export-btn {
    flex-direction: column-reverse;
  }
  .cadstudio-app.m-open-project .ws-file-actions .ws-action-divider {
    display: none;
  }
  .ws-workspace-bar {
    min-height: 42px;
    padding: 0;
    overflow-x: auto;
  }
  .ws-workspaces button {
    min-width: 78px;
    min-height: 42px;
    padding: 0 10px;
  }
  .ws-workspace-state {
    display: none;
  }
  .ws-ribbon-panel {
    min-height: 66px;
    padding: 5px 6px;
  }
  .cadstudio-app .ws-group {
    padding-left: 0;
  }
  .cadstudio-app .wsg-title {
    display: none;
  }
  .cadstudio-app .wsr-btn {
    min-width: 108px;
    min-height: 56px;
    padding: 5px 8px;
  }
  .ws-tree,
  .cadstudio-app .ws-side {
    display: contents;
  }
  .ws-tree > :not(.wsp-history),
  .ws-tree .wsp,
  .cadstudio-app .ws-side .wsp,
  .ws-inspector-empty,
  .cadstudio-app .ws-side > .ws-panel-cap {
    display: none;
  }
  .cadstudio-app .ws-side .ws-agent-flight-recorder:not([hidden]) {
    position: fixed;
    right: 8px;
    bottom: calc(var(--bw-sheet-bottom, 0px) + 76px);
    z-index: 24;
    display: block;
    width: min(360px, calc(100vw - 16px));
    max-height: 190px;
    border: 1px solid #2d465a;
    border-top: 2px solid #4db4ff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  }
  .cadstudio-app .ws-side .ws-agent-flight-recorder[data-collapsed='true'] {
    width: min(260px, calc(100vw - 16px));
  }
  #bw-agent-flight-recorder-log { max-height: 130px; }
  #bw-context-wrap:not([hidden]),
  .cadstudio-app.m-open-params .ws-side .wsp-params,
  .cadstudio-app.m-open-history .ws-tree .wsp-history {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bw-sheet-bottom, 0px);
    z-index: 30;
    max-height: 46%;
    overflow-y: auto;
    padding: 4px 10px 12px;
    border-top: 1px solid #405b72;
    border-radius: 9px 9px 0 0;
    background: #172634;
    box-shadow: 0 -10px 28px rgba(0,0,0,.42);
  }
  .cadstudio-app[data-document-kind='assembly'].m-open-history .ws-tree {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--bw-sheet-bottom, 0px);
    z-index: 30;
    max-height: 54%;
    overflow-y: auto;
    padding: 6px 10px 12px;
    border-top: 1px solid #405b72;
    border-radius: 9px 9px 0 0;
    background: #172634;
    box-shadow: 0 -10px 28px rgba(0,0,0,.42);
  }
  .cadstudio-app[data-document-kind='assembly'].m-open-history .ws-tree > .ws-assemblies,
  .cadstudio-app[data-document-kind='assembly'].m-open-history .ws-tree > .ws-mates,
  .cadstudio-app[data-document-kind='assembly'].m-open-history .ws-tree > .ws-inspection {
    display: block;
  }
  .cadstudio-app[data-document-kind='assembly'].m-open-history .ws-tree .datum-tree button,
  .cadstudio-app[data-document-kind='assembly'].m-open-history .ws-tree summary {
    min-height: 44px;
  }
  .ws-mtabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .ws-viewcube {
    top: 8px;
    right: 7px;
    transform: scale(.78);
    transform-origin: top right;
  }
  .ws-nav-rail {
    top: auto;
    right: 9px;
    bottom: 9px;
    flex-direction: row;
  }
  .ws-nav-rail button {
    width: 44px;
    height: 44px;
    border-right: 1px solid #2b3d4e;
    border-bottom: 0;
  }
  .ws-axis-triad {
    left: 10px;
    bottom: 10px;
    transform: scale(.78);
    transform-origin: bottom left;
  }
  .ws-selection-tools {
    bottom: 62px;
    max-width: calc(100% - 20px);
  }
  .ws-selection-tools label { font-size: 0; }
  .ws-selection-tools select { font-size: 10px; }
  .cadstudio-app .mode-label {
    top: 8px;
    left: 8px;
    max-width: calc(100% - 105px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cadstudio-app .pick-bar {
    top: 48px;
    left: 8px;
    right: 8px;
    max-width: none;
    transform: none;
  }
  .ws-command-help {
    display: none;
  }
  .cadstudio-app .ws-cmd-actions {
    margin-left: auto;
  }
  .ws-status-mode,
  .ws-kernel-state {
    display: none;
  }
}

/* ----------------------------------------------------------------------
   CAD desktop chrome — the tutorial video's information architecture.
   A narrow application title strip, text tabs, a dense grouped ribbon,
   document tabs, then the uninterrupted modeling viewport.
   ---------------------------------------------------------------------- */
.cadstudio-app {
  --cad-title: #1b222c;
  --cad-tabs: #222b36;
  --cad-ribbon: #303a47;
  --cad-ribbon-deep: #29333f;
  --cad-viewport: #1b242d;
  --cad-line: #485361;
  --cad-line-soft: #35404d;
  --cad-text: #d6dde5;
  --cad-muted: #8d9aa7;
  --cad-blue: #4b9bd3;
  --v3-ink: var(--cad-viewport);
  --v3-rail: var(--cad-tabs);
  --v3-panel: #202a35;
  --v3-panel-2: #26313d;
  --v3-line: var(--cad-line);
  --v3-line-soft: var(--cad-line-soft);
  --v3-text: var(--cad-text);
  --v3-muted: var(--cad-muted);
  --v3-blue: var(--cad-blue);
  font-family: "Segoe UI", Arial, ui-sans-serif, sans-serif;
}

/* quick-access and title bar */
.cadstudio-app .ws-appbar {
  min-height: 32px;
  height: 32px;
  grid-template-columns: minmax(170px, 1fr) minmax(210px, auto) minmax(420px, 1fr);
  gap: 8px;
  padding: 0 7px;
  border-bottom: 1px solid #10161d;
  background: var(--cad-title);
  box-shadow: 0 1px rgba(255, 255, 255, 0.035) inset;
}
.cadstudio-app .ws-brand {
  min-width: 0;
  gap: 7px;
}
.cadstudio-app .ws-brand-mark {
  width: 22px;
  height: 22px;
  border-color: #526171;
  border-radius: 1px;
  background: #283542;
  color: #b7d9f1;
  font-size: 7px;
}
.cadstudio-app .ws-brand b {
  color: #ccd5de;
  font-size: 10px;
  font-weight: 600;
}
.cadstudio-app .ws-brand small {
  display: none;
}
.cadstudio-app .ws-document {
  justify-self: center;
  min-width: 0;
  max-width: 420px;
  height: 30px;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #b9c3cd;
  white-space: nowrap;
}
.cadstudio-app .ws-document-kind {
  align-self: center;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 10px;
  padding: 0;
  border: 0;
  color: #aeb9c4;
  font: 600 10px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
}
.cadstudio-app .ws-document-separator {
  align-self: center;
  flex: 0 0 auto;
  margin: 0 5px;
  color: #65717e;
  font: 400 10px/1 "Segoe UI", Arial, sans-serif;
}
.cadstudio-app .ws-document .ws-project-name,
.cadstudio-app .ws-document-suffix {
  align-self: center;
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  color: #d2dae2;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}
.cadstudio-app .ws-document .ws-project-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cadstudio-app .ws-document-suffix {
  flex: 0 0 auto;
  margin-left: 5px;
  color: #808d99;
}
.cadstudio-app .ws-document .ws-local {
  align-self: center;
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 0;
  font-size: 8px;
  line-height: 1;
}
.cadstudio-app .ws-app-actions {
  justify-self: end;
  gap: 0;
}
.cadstudio-app .ws-edit-actions,
.cadstudio-app .ws-file-actions {
  gap: 0;
  padding-right: 2px;
  border-right-color: #3a4551;
}
.cadstudio-app .ws-app-actions .ws-quick-btn,
.cadstudio-app .ws-app-actions .ws-quick-labeled {
  min-width: 28px !important;
  min-height: 27px;
  height: 27px;
  gap: 0;
  padding: 0 5px;
  border-radius: 1px;
}
.cadstudio-app .ws-app-actions .ws-quick-btn > span:not(.ws-quick-icon):not(.ws-visually-hidden),
.cadstudio-app .ws-export-btn > span:first-child,
.cadstudio-app .ws-clear-label {
  display: none;
}
.cadstudio-app .ws-app-actions #pm-agent-access {
  min-width: 66px !important;
  gap: 5px;
  color: #c5e5fb;
}
.cadstudio-app .ws-app-actions #pm-agent-access > .pm-account-link-label {
  display: inline;
  white-space: nowrap;
}
.cadstudio-app .ws-app-actions .ws-quick-btn:hover,
.cadstudio-app .ws-app-actions .ws-quick-btn[aria-pressed='true'] {
  border-color: #596979;
  background: #344250;
}
.cadstudio-app .ws-app-actions .ws-quick-icon,
.cadstudio-app .ws-app-actions .ws-quick-icon .ws-icon {
  width: 15px;
  height: 15px;
}
.cadstudio-app .ws-action-divider {
  height: 18px;
  background: #3d4855;
}

/* tab rail */
.cadstudio-app .ws-ribbon {
  flex: 0 0 auto;
  border-bottom: 1px solid #111820;
  background: var(--cad-tabs);
}
.cadstudio-app .ws-workspace-bar {
  min-height: 29px;
  height: 29px;
  padding: 0 5px;
  border-bottom: 1px solid #45505d;
  background: var(--cad-tabs);
}
.cadstudio-app .ws-workspaces {
  gap: 0;
}
.cadstudio-app .ws-workspaces button {
  min-width: 0;
  padding: 0 13px;
  color: #b5c0ca;
  font: 400 11px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.cadstudio-app .ws-workspaces button::after {
  left: 8px;
  right: 8px;
  height: 2px;
}
.cadstudio-app .ws-workspaces button:hover:not(:disabled):not([aria-disabled='true']) {
  background: #34404d;
  color: #f1f5f8;
}
.cadstudio-app .ws-workspaces button[aria-selected='true'] {
  background: var(--cad-ribbon);
  color: #fff;
}
.cadstudio-app .ws-workspaces button[aria-selected='true']::after {
  background: var(--cad-blue);
  box-shadow: none;
}
.cadstudio-app .ws-workspaces button:disabled,
.cadstudio-app .ws-workspaces button[aria-disabled='true'] {
  color: #687581;
}
.cadstudio-app .ws-workspace-state {
  gap: 6px;
  padding-right: 6px;
}
.cadstudio-app .ws-workspace-state > span {
  width: 5px;
  height: 5px;
  background: var(--cad-blue);
  box-shadow: none;
}
.cadstudio-app .ws-workspace-state b {
  color: #aeb9c3;
  font-size: 9px;
  font-weight: 500;
}
.cadstudio-app .ws-workspace-state small {
  color: #778491;
  font-size: 8px;
}

/* dense grouped ribbon */
.cadstudio-app .ws-ribbon-panel {
  align-items: stretch;
  min-height: 112px;
  height: 112px;
  padding: 4px 4px 2px;
  background: var(--cad-ribbon);
  scrollbar-color: #637181 #2b3541;
}
.cadstudio-app .ws-ribbon-panel[hidden] {
  display: none;
}
.cadstudio-app .ws-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: max-content;
  height: 104px;
  padding: 0 7px 18px;
  border-right: 1px solid #1f2832;
  box-shadow: 1px 0 rgba(255, 255, 255, 0.055);
}
.cadstudio-app .wsg-title {
  position: absolute;
  left: 4px;
  right: 4px;
  top: auto;
  bottom: 1px;
  display: block;
  width: auto;
  height: 15px;
  margin: 0;
  padding: 2px 5px 0;
  border: 0;
  color: #9ca8b3;
  font: 400 9px/1 "Segoe UI", Arial, sans-serif;
  text-align: center;
  white-space: nowrap;
}
.cadstudio-app .wsg-tools {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 82px;
}
.cadstudio-app .wsg-stack {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, 22px);
  grid-auto-columns: minmax(124px, auto);
  gap: 1px 3px;
}
.cadstudio-app .ws-view-state-manager { min-width: 500px; }
.ws-view-state-create {
  display: grid;
  grid-template-columns: 150px auto;
  gap: 3px;
  height: 24px;
}
.ws-view-state-create label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  color: #9ca8b3;
  font: 9px/1 "Segoe UI", Arial, sans-serif;
}
.ws-view-state-create input,
.ws-view-state-create button,
.ws-view-state-row button {
  min-height: 22px;
  border: 1px solid #596775;
  border-radius: 1px;
  background: #394651;
  color: #f0f2f4;
  font: 9px/1 "Segoe UI", Arial, sans-serif;
}
.ws-view-state-create input { min-width: 0; padding: 0 5px; background: #202a33; }
.ws-view-state-create > span { display: flex; gap: 2px; }
.ws-view-state-create button { padding: 0 7px; cursor: pointer; }
.ws-view-state-create button:hover,
.ws-view-state-row button:hover { border-color: #77a6d3; background: #47627a; }
.ws-view-state-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  height: 57px;
  padding-top: 3px;
}
.ws-view-state-lists section { min-width: 0; overflow: hidden; border: 1px solid #46525e; background: #242e37; }
.ws-view-state-lists section > b {
  display: block;
  padding: 2px 5px;
  border-bottom: 1px solid #46525e;
  color: #9ca8b3;
  font: 700 8px/1.1 "Segoe UI", Arial, sans-serif;
}
.ws-view-state-lists ol { max-height: 37px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.ws-view-state-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2px;
  min-height: 20px;
  padding-left: 5px;
  border-top: 1px solid rgba(255, 255, 255, .04);
  color: #d6dde3;
  font: 9px/1 "Segoe UI", Arial, sans-serif;
}
.ws-view-state-row.is-active { box-shadow: inset 2px 0 #5ca7ed; background: #293d4e; }
.ws-view-state-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-view-state-row button { min-width: 22px; padding: 0 4px; cursor: pointer; }
.cadstudio-app .ws-scene-controls {
  display: grid;
  grid-template-columns: 118px 210px;
  grid-template-rows: 25px 25px 27px;
  gap: 2px 5px;
  min-width: 350px;
}
.ws-scene-controls > label,
.ws-scene-controls > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #c8d0d7;
  font: 9px/1 "Segoe UI", Arial, sans-serif;
}
.ws-scene-controls > label:nth-of-type(2) { grid-column: 2; }
.ws-scene-controls > span { grid-column: 1 / 3; gap: 12px; }
.ws-scene-controls select,
.ws-scene-controls button {
  min-height: 22px;
  border: 1px solid #596775;
  border-radius: 1px;
  background: #394651;
  color: #f0f2f4;
  font: 9px/1 "Segoe UI", Arial, sans-serif;
}
.ws-scene-controls select { min-width: 70px; }
.ws-scene-controls input[type='range'] { width: 105px; accent-color: #5ca7ed; }
.ws-scene-controls input[type='checkbox'] { accent-color: #5ca7ed; }
.ws-scene-controls output { min-width: 30px; color: #9fc8ed; font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ws-scene-controls button { grid-column: 1 / 3; padding: 0 8px; cursor: pointer; }
.ws-scene-controls button:hover { border-color: #77a6d3; background: #47627a; }
.cadstudio-app .wsr-btn,
.cadstudio-app .wsr-btn.is-large,
.cadstudio-app .wsr-btn.is-compact {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 1px;
  background: transparent;
  color: var(--cad-text);
  box-shadow: none;
  text-align: left;
}
.cadstudio-app .wsr-btn.is-large {
  flex: 0 0 74px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 74px;
  height: 82px;
  padding: 4px 5px 3px;
  text-align: center;
}
.cadstudio-app .wsr-btn.is-compact {
  flex-direction: row;
  width: 100%;
  height: 22px;
  padding: 1px 5px;
}
.cadstudio-app .wsr-btn:hover {
  border-color: #71808e;
  background: #43515f;
}
.cadstudio-app .wsr-btn.on,
.cadstudio-app .wsr-btn[aria-pressed='true'] {
  border-color: #76b5df;
  background: #316f9b;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}
.cadstudio-app .wsr-btn .wsr-i,
.cadstudio-app .wsr-btn .wsr-i .ws-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  color: #a7d0eb;
}
.cadstudio-app .wsr-btn.is-large .wsr-i,
.cadstudio-app .wsr-btn.is-large .wsr-i .ws-icon {
  width: 34px;
  height: 34px;
}
.cadstudio-app .wsr-btn .wsr-label {
  align-self: auto;
  color: inherit;
  font: 400 10px/1.1 "Segoe UI", Arial, sans-serif;
  white-space: nowrap;
}
.cadstudio-app .wsr-btn.is-large .wsr-label {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}
.cadstudio-app .wsr-btn small {
  display: none;
}

/* open-document rail */
.cadstudio-app .ws-document-tabs {
  flex: 0 0 32px;
  display: flex;
  align-items: stretch;
  min-height: 32px;
  border-top: 1px solid #46515d;
  border-bottom: 1px solid #111820;
  background: #202934;
  color: #adb8c2;
}
.cadstudio-app .ws-document-tabs a,
.cadstudio-app .ws-document-tabs button {
  border: 0;
  border-right: 1px solid #111820;
  background: transparent;
  color: inherit;
  font: 400 10px/1 "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.cadstudio-app .ws-doc-menu {
  display: grid;
  place-items: center;
  width: 37px;
  font-size: 15px !important;
}
.cadstudio-app .ws-doc-start {
  display: grid;
  place-items: center;
  min-width: 58px;
  padding: 0 12px;
}
.cadstudio-app .ws-doc-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 145px;
  max-width: 260px;
  padding: 0 15px 0 10px;
  border-right: 1px solid #111820;
  background: #303b47;
  color: #eef2f5;
  font-size: 10px;
}
.cadstudio-app .ws-doc-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--cad-blue);
}
.cadstudio-app .ws-doc-tab > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cadstudio-app .ws-doc-tab i {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #62bf85;
}
.cadstudio-app .ws-doc-cube {
  color: #91c7e8;
  font-size: 15px;
}
.cadstudio-app .ws-doc-new {
  width: 35px;
  font-size: 18px !important;
}
.cadstudio-app .ws-document-tabs a:hover,
.cadstudio-app .ws-document-tabs button:hover {
  background: #36434f;
  color: #fff;
}
.cadstudio-app .ws-doc-spacer {
  flex: 1;
}
.cadstudio-app .ws-visual-style {
  display: flex;
  align-items: center;
  padding: 0 11px;
  color: #7f8d9b;
  font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cadstudio-app .ws-main,
.cadstudio-app #bw-studio {
  min-height: 0;
}
.cadstudio-app #bw-studio {
  background: var(--cad-viewport);
}

@media (max-width: 1180px) {
  .cadstudio-app .ws-appbar {
    grid-template-columns: minmax(120px, 1fr) minmax(180px, auto) minmax(300px, 1fr);
  }
  .cadstudio-app .ws-document-suffix,
  .cadstudio-app .ws-document .ws-local,
  .cadstudio-app .ws-workspace-state small {
    display: none;
  }
  .cadstudio-app .ws-workspaces button {
    padding-inline: 10px;
  }
}

@media (min-width: 761px) and (max-width: 960px) {
  .cadstudio-app .ws-document {
    max-width: 160px;
  }
  .cadstudio-app .ws-document-kind,
  .cadstudio-app .ws-document-separator {
    display: none;
  }
  .cadstudio-app .ws-app-actions #pm-agent-access {
    min-width: 28px !important;
    gap: 0;
  }
  .cadstudio-app .ws-app-actions #pm-agent-access > .pm-account-link-label {
    display: none;
  }
}

@media (min-width: 761px) and (max-width: 820px) {
  .cadstudio-app .ws-document {
    max-width: 100px;
  }
}

@media (max-width: 760px) {
  .cadstudio-app .ws-appbar {
    min-height: 38px;
    height: 38px;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    gap: 4px;
    padding: 0 4px;
  }
  .cadstudio-app .ws-brand-mark {
    width: 26px;
    height: 26px;
  }
  .cadstudio-app .ws-brand > span:last-child,
  .cadstudio-app .ws-document-kind,
  .cadstudio-app .ws-document-separator,
  .cadstudio-app .ws-document-suffix,
  .cadstudio-app .ws-document .ws-local {
    display: none;
  }
  .cadstudio-app .ws-document {
    justify-self: stretch;
    height: 34px;
  }
  .cadstudio-app .ws-document .ws-project-name {
    display: block;
    width: 100%;
    padding-left: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cadstudio-app .ws-app-actions .ws-quick-btn,
  .cadstudio-app .ws-app-actions .ws-quick-labeled {
    min-width: 36px !important;
    min-height: 36px;
    height: 36px;
  }
  .cadstudio-app .ws-app-actions #pm-agent-access {
    min-width: 36px !important;
    gap: 0;
  }
  .cadstudio-app .ws-app-actions #pm-agent-access > .pm-account-link-label {
    display: none;
  }
  .cadstudio-app .ws-workspace-bar {
    min-height: 38px;
    height: 38px;
    padding: 0;
    overflow-x: auto;
  }
  .cadstudio-app .ws-workspaces button {
    min-width: auto;
    min-height: 38px;
    padding: 0 13px;
    white-space: nowrap;
  }
  .cadstudio-app .ws-ribbon-panel {
    min-height: 78px;
    height: 78px;
    padding: 3px;
  }
  .cadstudio-app .ws-group {
    height: 70px;
    padding: 0 4px;
  }
  .cadstudio-app .wsg-title {
    display: none;
  }
  .cadstudio-app .wsg-tools,
  .cadstudio-app .wsg-stack {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 70px;
  }
  .cadstudio-app .wsr-btn,
  .cadstudio-app .wsr-btn.is-large,
  .cadstudio-app .wsr-btn.is-compact {
    flex: 0 0 66px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 66px;
    min-width: 66px;
    height: 68px;
    min-height: 44px;
    padding: 3px 4px;
    text-align: center;
  }
  .cadstudio-app .wsr-btn .wsr-i,
  .cadstudio-app .wsr-btn .wsr-i .ws-icon,
  .cadstudio-app .wsr-btn.is-large .wsr-i,
  .cadstudio-app .wsr-btn.is-large .wsr-i .ws-icon {
    width: 27px;
    height: 27px;
  }
  .cadstudio-app .wsr-btn .wsr-label {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
  }
  .cadstudio-app .ws-document-tabs {
    flex-basis: 32px;
    min-height: 32px;
  }
  .cadstudio-app .ws-doc-start,
  .cadstudio-app .ws-visual-style {
    display: none;
  }
  .cadstudio-app .ws-doc-tab {
    min-width: 0;
    max-width: none;
    flex: 1;
  }
}

/* Keep the current variant legible after the compact app-bar rules collapse
 * ordinary labeled buttons to icons. */
@media (min-width: 761px) {
  .cadstudio-app .ws-app-actions #bw-configurations-open {
    min-width: 82px !important;
    gap: 5px;
  }
}
@media (max-width: 760px) {
  .cadstudio-app .ws-app-actions #bw-configurations-open {
    min-width: 36px !important;
    gap: 0;
  }
  #bw-configurations-open small { display: none; }
}

/* A short landscape viewport becomes a focused modeling workbench. Keep every
   sketch tool reachable in one horizontal rail, preserve that focus through
   Press / Pull, and give the canvas priority over document chrome. */
@media (max-height: 540px) {
  .ws-configurations {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .ws-configurations-head {
    grid-template-columns: minmax(0, 1fr) 34px;
    min-height: 54px;
    padding: 7px 10px 7px 13px;
  }
  .ws-configurations-head p,
  .ws-configurations-active {
    display: none;
  }
  .ws-config-workbench {
    overflow: auto;
  }
  .ws-config-editor {
    display: block;
    overflow: visible;
  }
  .ws-config-detail {
    overflow: visible;
  }
  .ws-config-detail-head {
    position: static;
  }
  .ws-config-design-table {
    min-height: 220px;
  }
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-workspace-bar,
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-document-tabs,
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-tree,
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-side,
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-mtabs,
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-cmd,
  .cadstudio-app:is([data-mode='choose-face'], [data-mode='sketching'], [data-mode='press-pull']) .ws-status {
    display: none;
  }
  .cadstudio-app[data-mode='choose-face'] .ws-ribbon,
  .cadstudio-app[data-mode='press-pull'] .ws-ribbon {
    display: none;
  }
  .cadstudio-app[data-mode='choose-face'] #bw-face {
    top: 10px;
    left: 10px;
    right: 10px;
    flex-wrap: nowrap;
    max-width: none;
    max-height: calc(100% - 20px);
    overflow-x: auto;
    overflow-y: hidden;
    transform: none;
    white-space: nowrap;
  }
  .cadstudio-app[data-mode='choose-face'] #bw-face .sk-note {
    display: none;
  }
  .cadstudio-app[data-mode='choose-face'] #bw-face > * {
    flex: 0 0 auto;
  }
  .cadstudio-app[data-mode='press-pull'] .pp-card {
    top: 10px;
    left: 10px;
    max-height: calc(100% - 20px);
    overflow-y: auto;
  }
  .cadstudio-app[data-mode='press-pull'] .pp-card > p {
    display: none;
  }
  .cadstudio-app[data-mode='press-pull'] .pp-actions {
    margin-top: 8px;
  }
  .cadstudio-app[data-mode='sketching'] .ws-ribbon-panel {
    min-height: 44px;
    height: 44px;
    padding: 2px;
  }
  .cadstudio-app[data-mode='sketching'] #rib-sketch {
    height: 40px;
    padding: 0;
  }
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsg-title {
    display: none;
  }
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsg-tools {
    height: 40px;
  }
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsr-btn,
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsr-btn.is-large {
    flex: 0 0 auto;
    flex-direction: row;
    width: auto;
    min-width: 58px;
    height: 40px;
    min-height: 40px;
    padding: 2px 7px;
  }
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsr-btn .wsr-i,
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsr-btn .wsr-i .ws-icon,
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsr-btn.is-large .wsr-i,
  .cadstudio-app[data-mode='sketching'] #rib-sketch .wsr-btn.is-large .wsr-i .ws-icon {
    width: 18px;
    height: 18px;
  }
  .cadstudio-app[data-mode='sketching'] .sk-top,
  .cadstudio-app[data-mode='sketching'] .sk-bottom {
    flex-wrap: nowrap;
    min-height: 40px;
    height: 40px;
    padding: 4px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .cadstudio-app[data-mode='sketching'] .sk-top > b,
  .cadstudio-app[data-mode='sketching'] .sk-bottom > .sk-note {
    display: none;
  }
  .cadstudio-app[data-mode='sketching'] .sk-op,
  .cadstudio-app[data-mode='sketching'] .sk-actions,
  .cadstudio-app[data-mode='sketching'] #bw-sk-dims {
    display: inline-flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: max-content;
    white-space: nowrap;
  }
  .cadstudio-app[data-mode='sketching'] #bw-sk-dims input[type='text'] {
    width: 56px;
  }
}
