:root {
  --navy: #142b3c;
  --ink: #203745;
  --muted: #71818c;
  --line: #dfe6ea;
  --paper: #fff;
  --bg: #f1f4f6;
  --orange: #d75e30;
  --blue: #176b97;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font:
    16px/1.45 'Segoe UI',
    Arial,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
.file-button {
  cursor: pointer;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}
button:hover,
.file-button:hover {
  background: #edf4f7;
  border-color: #adc4d0;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #71b9df;
  outline-offset: 2px;
}
button.primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
button.primary:hover {
  background: #bd4d24;
}
input,
select {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  width: 100%;
  background: white;
  color: var(--ink);
  min-width: 0;
}
input[type='checkbox'] {
  width: auto;
  accent-color: var(--blue);
}
header {
  height: 86px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 26px;
}
header button {
  background: #233d50;
  border-color: #3b5160;
  color: white;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 19px;
  letter-spacing: 1px;
  font-weight: 750;
}
.logo {
  width: 38px;
  height: 42px;
  background: var(--orange);
  display: grid;
  place-items: center;
  font-size: 27px;
  border-radius: 8px;
}
.brandlight {
  font-weight: 350;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 400;
  color: #a8c0cc;
}
.project-title {
  border-left: 1px solid #415361;
  padding-left: 25px;
  flex: 1;
  max-width: 340px;
}
.project-title input {
  background: none;
  color: white;
  border: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
}
.project-title span {
  font-size: 12px;
  color: #acbeca;
}
.badge {
  font-size: 11px;
  letter-spacing: 1px;
  border: 1px solid #61727c;
  padding: 5px 8px;
  border-radius: 4px;
  color: #bcd0dc;
}
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.view-tabs {
  height: 58px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  gap: 25px;
  overflow: auto;
}
.view-tabs button {
  border: 0;
  border-radius: 0;
  color: #8b9aa4;
  background: none;
  padding: 16px 7px 12px;
  border-bottom: 3px solid transparent;
  font-size: 12px;
}
.view-tabs b {
  font-size: 14px;
  font-weight: 550;
  margin-left: 7px;
  color: #667985;
}
.view-tabs .active {
  border-bottom-color: var(--orange);
}
.view-tabs .active b {
  color: var(--navy);
}
.workspace {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 284px;
  min-height: calc(100vh - 144px);
}
.left-panel,
.right-panel {
  background: white;
}
.left-panel {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 13px;
}
.panel-head button {
  padding: 1px 9px;
  font-size: 20px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.7px;
  font-weight: 650;
  color: var(--muted);
}
#floorList {
  padding: 0 12px;
}
.floor {
  width: 100%;
  text-align: left;
  margin-bottom: 5px;
  padding: 11px;
  background: #f7f9fa;
}
.floor.active {
  background: #e9f2f7;
  border-color: #bbd2df;
  color: #175f83;
}
.section-label {
  display: flex;
  justify-content: space-between;
  padding: 23px 17px 10px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.section-label span {
  background: #edf1f4;
  border-radius: 4px;
  padding: 0 6px;
}
#roomList {
  padding: 0 8px;
}
.room-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  margin-bottom: 3px;
  padding: 10px 9px;
  border-radius: 6px;
  text-align: left;
}
.room-button.active {
  background: #fff2eb;
  border-color: #f0c5b1;
}
.room-button .room-id {
  font: 12px monospace;
  color: var(--muted);
  background: #f1f4f6;
  border-radius: 4px;
  padding: 5px;
}
.room-button.active .room-id {
  background: #e26b3b;
  color: white;
}
.room-button b {
  font-size: 14px;
  font-weight: 550;
  display: block;
}
.room-button small {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.room-button .color-dot {
  width: 5px;
  align-self: stretch;
  border-radius: 2px;
  margin-left: auto;
}
.left-bottom {
  padding: 18px 14px;
  margin-top: auto;
}
.left-bottom button {
  width: 100%;
  text-align: left;
}
.left-bottom p {
  font-size: 12px;
  color: var(--muted);
}
main {
  min-width: 0;
}
.canvas-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px 17px;
  gap: 12px;
}
h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin: 3px 0 0;
}
h2 {
  font-size: 23px;
  font-weight: 600;
  margin: 5px 0 18px;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 18px 0 10px;
}
.canvas-actions {
  display: flex;
  gap: 6px;
}
.file-button input {
  display: none;
}
.drawing-tools {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 20px 14px;
}
.drawing-tools button {
  font-size: 13px;
  padding: 7px 9px;
  background: transparent;
  border-color: transparent;
}
.drawing-tools button.active {
  background: var(--navy);
  color: white;
}
.drawing-tools button:hover {
  border-color: #abc1cd;
}
#canvasWrap {
  position: relative;
  margin: 0 20px;
  border: 1px solid #d9e2e7;
  border-radius: 8px;
  background: #fcfdfd;
  overflow: hidden;
  min-height: 430px;
  height: calc(100vh - 405px);
}
#drawing {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}
#drawing text {
  user-select: none;
  font-family: 'Segoe UI', Arial, sans-serif;
}
.canvas-legend {
  position: absolute;
  left: 14px;
  bottom: 13px;
  display: flex;
  gap: 12px;
  padding: 7px 9px;
  background: #ffffffec;
  border-radius: 4px;
  font-size: 11px;
  color: #637681;
  pointer-events: none;
}
.canvas-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.canvas-legend i {
  width: 13px;
  height: 3px;
}
.canvas-scale {
  position: absolute;
  right: 14px;
  bottom: 15px;
  color: var(--muted);
  font-size: 12px;
}
.canvas-bottom {
  display: flex;
  gap: 14px;
  padding: 12px 22px;
  font-size: 12px;
  color: var(--muted);
  align-items: center;
  flex-wrap: wrap;
}
.canvas-bottom > span {
  margin-right: auto;
}
.canvas-bottom label {
  white-space: nowrap;
}
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 5px 20px 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px 0;
}
.metric {
  padding: 0 19px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric span {
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--muted);
  display: block;
}
.metric b {
  display: block;
  font-size: 25px;
  font-weight: 550;
  margin-top: 3px;
}
.metric em {
  font-size: 13px;
  font-weight: 400;
  font-style: normal;
  color: var(--muted);
}
.right-panel {
  border-left: 1px solid var(--line);
  padding: 22px 19px;
}
.right-panel .tag {
  color: var(--orange);
  font-size: 12px;
  font-family: monospace;
}
.right-panel h2 {
  font-size: 21px;
  margin-top: 6px;
}
.right-panel label,
.field label {
  font-size: 13px;
  color: #607784;
  display: block;
  margin: 11px 0 5px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.value-line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eef1f3;
  font-size: 14px;
  padding: 9px 0;
}
.value-line span {
  color: var(--muted);
}
.notice {
  background: #fff6e7;
  border: 1px solid #f0dfbd;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #8c692f;
  margin-top: 17px;
}
.info-box {
  padding: 12px;
  background: #edf4f8;
  border-radius: 6px;
  color: #426e86;
  font-size: 13px;
  margin: 14px 0;
}
.danger {
  color: #ae3a34 !important;
}
.right-panel button.full {
  width: 100%;
  margin-top: 10px;
}
.right-panel details {
  font-size: 12px;
  margin-top: 15px;
  color: var(--muted);
}
.right-panel summary {
  cursor: pointer;
}
.right-panel ul {
  padding-left: 17px;
}
#contentView {
  padding: 25px;
  overflow: auto;
}
.content-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.content-heading h1 {
  margin: 6px 0;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
th {
  background: #edf2f5;
  font-size: 12px;
  color: #536f7f;
  font-weight: 550;
  white-space: nowrap;
}
td,
th {
  padding: 13px 14px;
  border-bottom: 1px solid #e9eef1;
}
tr:last-child td {
  border: 0;
}
td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody tr:hover {
  background: #f7fafc;
}
.chip {
  padding: 3px 7px;
  font-size: 12px;
  border-radius: 4px;
  background: #fff0d9;
  color: #896022;
  white-space: nowrap;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 21px;
}
.card a {
  color: var(--blue);
}
.card p {
  font-size: 14px;
}
.wide {
  grid-column: 1/-1;
}
.axon-svg {
  width: 100%;
  height: 590px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.manifold-svg {
  width: 100%;
  height: auto;
  min-height: 370px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#drawPrompt {
  position: absolute;
  bottom: 55px;
  left: 12px;
  right: 12px;
  background: var(--navy);
  border-radius: 6px;
  padding: 10px;
  color: white;
  font-size: 13px;
  align-items: center;
  gap: 8px;
}
#drawPrompt:not([hidden]) {
  display: flex;
}
#drawPrompt span {
  margin-right: auto;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  background: var(--navy);
  color: white;
  padding: 13px 22px;
  border-radius: 8px;
  max-width: 90vw;
  box-shadow: 0 8px 32px #142b3c33;
  font-size: 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
  max-width: 540px;
  width: calc(100vw - 30px);
  box-shadow: 0 20px 70px #122b3c44;
}
dialog::backdrop {
  background: #142b3c77;
}
dialog p {
  font-size: 14px;
  color: var(--muted);
}
.dialog-close {
  float: right;
  font-size: 22px;
  padding: 0 7px;
}
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 23px;
}
[hidden] {
  display: none !important;
}
.check-list {
  font-size: 14px;
  padding-left: 20px;
  color: #586f7b;
}
.subtle-btn {
  border: none;
  background: none;
  text-decoration: underline;
  font-size: 12px;
  padding: 5px 0;
}
.scroll-hint {
  display: none;
}
@media (min-width: 1700px) {
  .workspace {
    grid-template-columns: 255px minmax(0, 1fr) 310px;
  }
  #canvasWrap {
    min-height: 580px;
  }
}
@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .right-panel {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    display: block;
    padding: 20px;
  }
  .right-panel .inspector-inner {
    max-width: 760px;
    margin: auto;
  }
  .badge {
    display: none;
  }
  .project-title {
    max-width: 230px;
  }
  .canvas-top {
    padding: 17px 20px;
  }
  #canvasWrap {
    height: 520px;
  }
  .view-tabs {
    gap: 15px;
  }
  .brand {
    font-size: 16px;
  }
  .header-actions button {
    padding: 8px;
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  header {
    height: auto;
    min-height: 100px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
  }
  .brand {
    flex: 1;
  }
  .brand small {
    font-size: 9px;
  }
  .project-title {
    border: none;
    padding: 0;
    max-width: none;
    flex: 1;
  }
  .header-actions {
    width: 100%;
    margin: 0;
  }
  .header-actions button {
    flex: 1;
  }
  .view-tabs {
    padding: 0 10px;
    gap: 7px;
    height: 53px;
  }
  .view-tabs button {
    padding: 13px 8px;
  }
  .view-tabs b {
    margin-left: 2px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .left-panel {
    border: 0;
  }
  .panel-head {
    padding: 12px 14px 6px;
  }
  #floorList {
    display: flex;
    gap: 7px;
    overflow: auto;
  }
  .floor {
    width: auto;
    flex-shrink: 0;
  }
  .section-label,
  .left-bottom {
    display: none;
  }
  #roomList {
    display: flex;
    overflow: auto;
    gap: 6px;
    padding: 7px 12px;
  }
  .room-button {
    width: auto;
    flex-shrink: 0;
    padding: 6px 8px;
    border-color: var(--line);
  }
  .room-button .color-dot {
    display: none;
  }
  .room-button b {
    font-size: 12px;
  }
  .room-button small {
    font-size: 11px;
  }
  .room-button .room-id {
    padding: 3px;
  }
  .canvas-top {
    padding: 15px 13px;
  }
  .canvas-top h1 {
    font-size: 21px;
  }
  .canvas-actions {
    gap: 4px;
  }
  .canvas-actions button,
  .file-button {
    padding: 7px;
    font-size: 12px;
  }
  .drawing-tools {
    padding: 0 10px 10px;
    gap: 1px;
  }
  .drawing-tools button {
    font-size: 12px;
    padding: 6px;
  }
  #canvasWrap {
    margin: 0 10px;
    height: 440px;
    min-height: 0;
  }
  .canvas-bottom {
    padding: 10px 13px;
    gap: 7px;
    font-size: 11px;
  }
  .canvas-bottom > span {
    width: 100%;
  }
  .metric-strip {
    margin: 5px 10px 15px;
    padding: 12px 0;
  }
  .metric {
    padding: 0 10px;
  }
  .metric span {
    font-size: 9px;
    letter-spacing: 0;
  }
  .metric b {
    font-size: 21px;
  }
  .metric em {
    font-size: 11px;
  }
  .right-panel {
    padding: 18px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  #contentView {
    padding: 18px 12px;
  }
  .content-heading {
    align-items: flex-start;
  }
  .content-heading h1 {
    font-size: 23px;
  }
  .axon-svg {
    height: 440px;
  }
  .canvas-legend {
    font-size: 10px;
    left: 8px;
    gap: 8px;
  }
  .canvas-scale {
    font-size: 10px;
    right: 8px;
  }
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .metric:nth-child(2) {
    border: 0;
  }
  #drawPrompt {
    font-size: 11px;
    flex-wrap: wrap;
  }
}
.automation-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 20px 10px;
}
.automation-bar button {
  font-size: 12px;
  padding: 6px 9px;
  background: #e8f0f5;
  border-color: #cbdce6;
}
.automation-bar button.active {
  background: #193e56;
  color: white;
}
.automation-bar [data-action] {
  background: #f8e8dc;
  border-color: #e5bea5;
}
.tool-separator {
  width: 1px;
  background: #ccd8df;
  margin: 0 5px;
}
.edition-note {
  font-size: 12px;
  color: #7a8c98;
  margin: 0 22px 15px;
}
.section-svg {
  width: 100%;
  height: auto;
  display: block;
  min-height: 190px;
}
.scope-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.view-tabs {
  gap: 14px;
}
.view-tabs button {
  padding-left: 4px;
  padding-right: 4px;
}
.card ol {
  padding-left: 22px;
  font-size: 14px;
}
.card li {
  margin: 6px 0;
}
.cards .card .field-row {
  gap: 14px;
}
.check-head {
  display: flex;
  gap: 10px;
}
@media (max-width: 760px) {
  .automation-bar {
    margin: 0 10px 10px;
    gap: 4px;
  }
  .automation-bar button {
    font-size: 11px;
    padding: 6px;
  }
  .view-tabs {
    gap: 6px;
  }
  .section-svg {
    min-width: 650px;
  }
  .card:has(.section-svg) {
    overflow: auto;
  }
  .tool-separator {
    display: none;
  }
}

.pipe-panel {
  border-top: 2px solid #c5d7e1;
  margin-top: 22px;
  padding-top: 22px;
}
.pipe-panel select {
  width: 100%;
  margin: 5px 0 10px;
}
.pipe-switches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.pipe-switches label {
  font-size: 12px;
}
.pipe-handle {
  cursor: grab;
}
.pipe-handle:active {
  cursor: grabbing;
}
.pipe-panel .info-box {
  margin: 10px 0;
}
.view-tabs {
  overflow-x: auto;
}
.view-tabs button {
  white-space: nowrap;
}
.automation-bar {
  flex-wrap: wrap;
}
.right-panel .inspector-inner {
  padding-bottom: 40px;
}

.pattern-buttons {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.pattern-buttons button {
  flex: 1;
}

.architecture-panel {
  padding: 0 0 18px;
  margin: 0 0 20px;
  border-bottom: 2px solid #bcd0d9;
}
.architecture-panel input:not([type='checkbox']),
.architecture-panel select {
  width: 100%;
  margin: 6px 0 12px;
}
.architecture-panel label {
  display: block;
}
.drawing-tools {
  flex-wrap: wrap;
}
[data-arch-handle],
[data-bundle-add] {
  cursor: grab;
}

.generation-panel {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 2px solid #dce6eb;
}
.generation-panel > .eyebrow {
  display: block;
  margin-bottom: 8px;
}
.generation-panel .notice {
  margin-bottom: 8px;
}

/* 0.5.7: compact task groups with explicit editing state and touch-sized controls. */
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
button:disabled:hover {
  background: inherit;
  border-color: var(--line);
}
.mobile-new {
  display: none;
}
.drawing-tools {
  display: block;
  padding-bottom: 12px;
}
.edit-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.drawing-tools button {
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
  min-height: 44px;
  padding: 8px 12px;
}
.drawing-tools button.primary {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}
.drawing-tools button.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.editor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  padding: 10px 0;
  color: #526c7b;
}
.editor-status b {
  color: var(--navy);
}
.editor-status button {
  padding: 5px 9px;
  min-height: 36px;
  font-size: 14px;
}
.tool-groups {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-groups details {
  flex: 1 1 200px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.tool-groups summary {
  cursor: pointer;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
}
.tool-groups details[open] {
  flex-basis: 100%;
}
.tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
}
.tool-groups summary:focus-visible {
  outline: 3px solid #71b9df;
  outline-offset: 2px;
}
.boundary-handle {
  cursor: grab;
}
.boundary-handle:active {
  cursor: grabbing;
}
.right-panel label,
.right-panel .muted,
.right-panel .notice,
.right-panel .info-box,
.pipe-switches label {
  font-size: 14px;
}
.right-panel button {
  min-height: 44px;
  white-space: normal;
}
.right-panel .pattern-buttons button[aria-pressed='true'] {
  background: var(--orange);
  color: white;
}
.architecture-panel > details,
.pipe-panel > details {
  margin-top: 10px;
}
.chip {
  white-space: normal;
}
.canvas-actions {
  flex-wrap: wrap;
}
.canvas-actions button,
.file-button {
  min-height: 44px;
  font-size: 14px;
}
.canvas-bottom {
  font-size: 14px;
}
.canvas-bottom input {
  min-width: 20px;
  min-height: 20px;
  vertical-align: middle;
}
.right-panel {
  scroll-margin-top: 12px;
}
@media (max-width: 760px) {
  .mobile-new {
    display: block;
  }
  .header-actions {
    flex-wrap: wrap;
  }
  .header-actions button {
    min-height: 44px;
    font-size: 14px;
    flex: 1 1 40%;
  }
  .canvas-top {
    flex-wrap: wrap;
  }
  .canvas-top h1 {
    font-size: 22px;
  }
  .canvas-actions {
    width: 100%;
  }
  .canvas-actions .file-button {
    margin-right: auto;
  }
  .edit-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .edit-toolbar button {
    white-space: normal;
  }
  .drawing-tools {
    padding: 0 10px 12px;
  }
  .tool-groups {
    gap: 6px;
  }
  .tool-groups details {
    flex-basis: 100%;
  }
  .tool-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .tool-group button {
    white-space: normal;
    padding: 8px;
  }
  .editor-status button {
    width: 100%;
    text-align: left;
  }
  .canvas-bottom {
    font-size: 14px;
    gap: 12px;
  }
  .room-button b {
    font-size: 14px;
  }
  .room-button small {
    font-size: 12px;
  }
  #drawPrompt {
    font-size: 14px;
  }
  #drawPrompt button {
    min-height: 44px;
  }
  .view-tabs b {
    font-size: 14px;
  }
}

.drawing-tools button.primary:disabled {
  background: #e8edf1;
  color: #71818c;
  border-color: #d9e1e6;
  opacity: 1;
}

.circuit-lengths {
  margin: 12px 0;
}
.length-over {
  color: #b42318;
  background: #fff1f0;
  padding: 8px;
  border-radius: 6px;
}
.circuit-lengths .value-line {
  gap: 10px;
  flex-wrap: wrap;
}
/* Building model view (spec 003) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px 14px;
  align-items: end;
  margin: 10px 0;
}
.construction-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}
.construction-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px auto auto;
  gap: 6px;
  align-items: center;
  margin: 4px 0;
}
.table-wrap td input[type='number'] {
  width: 90px;
}
.table-wrap td select {
  max-width: 220px;
}
.danger-text {
  color: #b42318;
}
.table-wrap td select {
  min-width: 120px;
}
.inline-check {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-right: 12px;
  font-weight: 400;
}
/* Facades and sections (spec 017) */
.dr-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.dr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dr-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.dr-item.active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}
.dr-item small {
  color: var(--muted);
}
.dr-add {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.dr-main {
  min-width: 0;
}
.dr-head {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.dr-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.dr-tools button.active {
  background: var(--navy);
  color: #fff;
}
.dr-sep {
  flex: 1;
}
.dr-hint {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 14px;
}
.dr-stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}
.dr-canvas,
.dr-plan {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}
.dr-canvas {
  height: 440px;
  cursor: crosshair;
}
.dr-plan {
  height: 260px;
}
.dr-plan.picking {
  cursor: crosshair;
  outline: 2px solid var(--orange);
}
.dr-issues {
  margin: 6px 0;
  padding-left: 18px;
}
.dr-issues li {
  margin: 4px 0;
}
.dr-preview {
  margin-top: 12px;
  border-color: var(--blue);
}
@media (max-width: 900px) {
  .dr-layout,
  .dr-stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .dr-canvas {
    height: 320px;
  }
}
/* Heat load (spec 004) */
.active-row td {
  background: #eef5f9;
}
.hl-calc {
  margin-top: -4px;
}
/* Library (spec 006) */
.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.library-layout tr.selected td {
  background: #eef5f9;
}
button.link {
  border: 0;
  background: none;
  padding: 0;
  color: #1f6f9a;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.library-manifold {
  margin-top: 18px;
}
@media (max-width: 900px) {
  .library-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.family-views {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.family-views figure {
  margin: 0;
  border: 1px solid var(--line, #d5dde2);
  border-radius: 6px;
  padding: 4px;
  background: #fff;
  text-align: center;
}
.family-views figcaption {
  font-size: 12px;
  color: #5d6d77;
}
.family-views svg {
  max-width: 100%;
  height: auto;
  max-height: 110px;
}

/* Spec 018: «15 Вузли й аркуші» */
.tb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
}
.tb-logo {
  display: block;
  max-width: 180px;
  max-height: 60px;
  margin: 6px 0;
}
.node-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 14px;
}
.node-grid table {
  width: 100%;
}
.node-view svg {
  width: 100%;
  height: auto;
  max-height: 420px;
}
.node-warn {
  color: var(--warn, #a15c00);
}
@media (max-width: 760px) {
  .node-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spec 019: interactive 3D node */
.node-3d canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  border-radius: 6px;
  touch-action: none;
}

/* Spec 024: catalog of materials, window types and typical constructions */
.cat-picker {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  background: rgba(20, 43, 60, 0.35);
  overflow-y: auto;
}
.cat-box {
  width: min(760px, 100%);
  background: var(--paper);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cat-box input[type='search'] {
  width: 100%;
}
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.cat-chips .chip.on,
.thick-row .on {
  background: var(--navy);
  color: #fff;
}
.cat-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.cat-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  white-space: normal;
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  min-width: 0;
}
.cat-item span,
.cat-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.cat-item .chip {
  justify-self: start;
}
.cat-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 0;
}
.cat-card ol {
  margin: 4px 0;
  padding-left: 20px;
}
.cat-section {
  width: 100%;
  max-width: 260px;
  height: auto;
}
.thick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 8px;
}

/* Spec 025: list of work quantities */
.works-section h2 {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.work-toggles {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}
.work-toggle.off {
  color: var(--muted);
  text-decoration: line-through;
}
