:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #243244;
  background: #e8edf1;
  font-synthesis: none;
  --accent: #285cd5;
  --muted: #657486;
  --line: #e3e8ee;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #5483eb;
  outline-offset: 4px;
}
.workspace {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
}
.sidebar {
  background: #fff;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #d7dfe7;
}
section h2 {
  font-size: 14px;
  margin: 0 0 12px;
  display: flex;
  justify-content: space-between;
}
h2 > span {
  color: var(--muted);
  font-weight: 400;
}
.sidebar section {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
}
.note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 12px 0 0;
}
.viewer {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #e8edf1;
}
.view-tools {
  position: absolute;
  right: 28px;
  top: 27px;
  z-index: 3;
  display: flex;
  background: #fff;
  border: 1px solid #d3dde6;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 3px 10px #22374808;
  gap: 3px;
}
.view-tools button {
  border: 0;
  background: transparent;
  color: #56677a;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 3px;
}
.view-tools button.active {
  background: #eaf0fc;
  color: #285cd5;
}
.view-tools button:hover {
  background: #f0f3f7;
}
#reset-view {
  border-left: 1px solid #e1e6eb;
  font-size: 19px;
  padding: 4px 12px;
  border-radius: 0;
}
#canvas-container {
  position: absolute;
  inset: 0;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.loading {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 16px 20px;
  border-radius: 5px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 90%;
  box-shadow: 0 4px 24px #18273515;
}
.loading[hidden] {
  display: none;
}
#dimension-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.dimension-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 4px 7px;
  background: #f7f9fcdf;
  color: #46678b;
  border: 1px solid #b9cbdc;
  border-radius: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dimension-label[hidden] {
  display: none;
}
.add-wall {
  width: 100%;
  padding: 11px 12px;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
}
.add-wall:hover {
  background: #214fb9;
}
.duplicate-module {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f7f9fc;
  color: var(--accent);
  border: 1px solid #b9c9ea;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
}
.duplicate-module span {
  font-size: 18px;
  line-height: 0;
}
.duplicate-module:hover {
  background: #edf3ff;
  border-color: #91abe1;
}
.wall-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  max-height: 150px;
  overflow: auto;
}
.wall-list:empty {
  margin: 0;
}
.wall-list button,
.wall-actions button {
  border: 1px solid #d6dfe9;
  background: white;
  color: #536174;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
}
.wall-list button.active {
  border-color: var(--accent);
  background: #edf3ff;
  color: var(--accent);
}
#wall-properties {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
#wall-properties[hidden] {
  display: none;
}
.wall-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.wall-field output {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.wall-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
#delete-wall {
  color: #a33838;
}
#wall-status:empty {
  margin: 0;
}
#module-status:empty {
  margin: 0;
}
#geometry-load-time {
  position: absolute;
  right: 26px;
  bottom: 18px;
  padding: 6px 9px;
  border-radius: 3px;
  background: #e8edf1dd;
  font-size: 13px;
  font-weight: 600;
  color: #344b66;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 1000px) {
  .view-tools {
    top: 18px;
    right: 18px;
  }
  #geometry-load-time {
    right: 18px;
  }
}
@media (max-width: 700px) {
  .workspace {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .viewer {
    grid-row: 1;
    height: 65dvh;
    min-height: 360px;
  }
  .sidebar {
    overflow: visible;
    border-right: 0;
    border-top: 1px solid #d7dfe7;
  }
  .sidebar section {
    padding: 16px 14px;
  }
  .view-tools {
    right: 12px;
  }
  .view-tools button {
    padding: 9px;
    font-size: 12px;
  }
  #geometry-load-time {
    right: 12px;
    bottom: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.object-editor select,
.object-editor input {
  font: inherit;
  font-size: 13px;
  width: 100%;
  min-width: 0;
  border: 1px solid #d6dfe9;
  border-radius: 4px;
  background: #fff;
  color: #243244;
  padding: 8px 5px;
}
.object-field {
  display: block;
  font-size: 12px;
  margin-top: 12px;
}
.object-field select,
.object-field input {
  margin-top: 5px;
}
.object-moves {
  display: flex;
  gap: 5px;
  margin-top: 12px;
}
.object-moves button,
#rotate-object {
  border: 1px solid #d6dfe9;
  border-radius: 4px;
  background: #f7f9fc;
  color: #285cd5;
  padding: 7px 10px;
}
#rotate-object {
  margin-top: 8px;
  width: 100%;
  font-size: 13px;
}
.object-editor [hidden] {
  display: none;
}
#object-status:empty {
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
