@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500&display=swap");

:root {
  --bg-top: #edf4ff;
  --bg-mid: #e8f3ee;
  --bg-bottom: #f5f8fc;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: #d5e1ef;
  --line-strong: #c0d2e6;
  --text: #182330;
  --text-soft: #4f6579;
  --accent: #0b7f88;
  --accent-2: #0d6aa8;
  --ok: #2f996f;
  --danger: #b83a3a;
  --shadow: 0 16px 34px rgba(24, 35, 48, 0.09);
  --free: #7ed957;
  --negotiation: #ffcd38;
  --negotiation-final: #ff7b45;
  --contracting: #46a7ff;
  --sold: #a7acb3;
  --sold-ds: #5b6471;
}

body.theme-dark {
  --bg-top: #0f1822;
  --bg-mid: #101f1b;
  --bg-bottom: #101621;
  --panel: rgba(17, 26, 36, 0.88);
  --panel-strong: rgba(20, 31, 43, 0.94);
  --line: #2f4256;
  --line-strong: #3f5872;
  --text: #e3edf7;
  --text-soft: #a9bed2;
  --accent: #26a2b3;
  --accent-2: #2a7bc0;
  --shadow: 0 16px 34px rgba(1, 8, 14, 0.45);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 10.4px;
  line-height: 1.3;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at -10% -20%, #d6e8ff 0%, transparent 60%),
    radial-gradient(1100px 650px at 120% 0%, #d8f1e5 0%, transparent 56%),
    linear-gradient(180deg, var(--bg-top), var(--bg-mid) 40%, var(--bg-bottom));
}

body.theme-dark {
  background:
    radial-gradient(1100px 700px at -10% -20%, #1b2d44 0%, transparent 62%),
    radial-gradient(980px 620px at 120% 0%, #1f3b34 0%, transparent 58%),
    linear-gradient(180deg, var(--bg-top), var(--bg-mid) 40%, var(--bg-bottom));
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 8px;
}

h2 {
  font-size: 7px;
}

h3 {
  font-size: 6.5px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.9), rgba(242, 248, 255, 0.74));
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  font-size: 8px;
  font-weight: 800;
}

.density-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  color: var(--text-soft);
}

.topbar button,
button {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 5px;
  font-family: inherit;
  font-weight: 700;
  font-size: 8px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.2s ease;
}

.topbar button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 127, 136, 0.28);
}

.topbar button:hover,
button:hover {
  transform: translateY(-1px);
}

.topbar button:active,
button:active {
  transform: translateY(0);
}

#jobResult {
  font-size: 8px;
  color: var(--text-soft);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(400px, 1fr);
  gap: 10px;
  padding: 10px;
  min-height: calc(100vh - 56px);
}

.pane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  overflow: auto;
  box-shadow: var(--shadow);
  backdrop-filter: blur(7px);
}

.pane-head-3d {
  margin-bottom: 6px;
}

.pane-head-3d .hint {
  margin-bottom: 0;
}

.pane-toggle-btn {
  background: linear-gradient(180deg, #f9fcff, #edf4fb);
  border: 1px solid var(--line-strong);
  color: #375069;
  white-space: nowrap;
}

.pane-3d.is-collapsed #pane3dBody {
  display: none;
}

.pane-3d.is-collapsed {
  overflow: hidden;
}

.hint {
  margin: 3px 0 6px;
  color: var(--text-soft);
  font-size: 8.8px;
}

#viewer3d {
  height: 390px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(165deg, #f8fbff, #edf5ff 54%, #e6f4ed);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.viewer-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: var(--text-soft);
}

.viewer-empty strong {
  color: var(--text);
}

.facade-floors {
  margin-top: 6px;
  border: 1px dashed var(--line-strong);
  padding: 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.facade-floors.hidden {
  display: none;
}

.facade-floors button,
.quick-select button,
.markup button,
.three-controls button {
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.quick-select {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
  align-items: center;
}

.quick-select strong {
  font-size: 8.8px;
  color: var(--text-soft);
  margin-right: 2px;
}

.three-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 8.8px;
  color: var(--text-soft);
}

.three-controls input[type="range"] {
  width: 120px;
}

#sectionLevelValue {
  min-width: 10px;
  display: inline-block;
  text-align: center;
  font-weight: 700;
  color: var(--text);
}

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  position: relative;
  z-index: 3;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 5px;
}

.controls {
  font-size: 8.8px;
  color: var(--text-soft);
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.editor-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 5px;
}

.tab-btn {
  background: linear-gradient(180deg, #f9fcff, #edf4fb);
  border: 1px solid var(--line-strong);
  color: #375069;
}

.icon-tab-btn,
.icon-tool-btn,
.editor-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}

.icon-tab-btn svg,
.icon-tool-btn svg,
.editor-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-btn.active {
  background: linear-gradient(180deg, #53b8dc, #2f86a9);
  border-color: #2f8bb3;
  color: #fff;
}

.floor-editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.78);
}

.floor-editor-panel.hidden {
  display: none;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 8px;
}

.editor-canvas-slot {
  margin-top: 6px;
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: stretch;
}

.editor-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

#closeFloorEditorModalBtn {
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #edf4fb);
  color: #324f68;
}

.editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 19, 31, 0.55);
  backdrop-filter: blur(3px);
}

.help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(8, 19, 31, 0.58);
  backdrop-filter: blur(4px);
}

.help-modal {
  position: fixed;
  inset: 14px;
  z-index: 2110;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.992), rgba(246, 250, 255, 0.986));
  box-shadow: 0 30px 75px rgba(9, 24, 37, 0.36);
  padding: 10px;
}

.help-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.help-modal-head h2 {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 2px;
}

#closeHelpModalBtn {
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #edf4fb);
  color: #324f68;
}

.help-modal-main {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(190px, 250px) 1fr;
  gap: 10px;
  min-height: 0;
  flex: 1;
}

.help-toc {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  padding: 6px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-toc-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: linear-gradient(180deg, #f9fcff, #edf4fb);
  color: #334c64;
  font-size: 8px;
  font-weight: 700;
}

.help-toc-item.active {
  background: linear-gradient(180deg, #4eb4d8, #2f84a8);
  border-color: #2f8bb3;
  color: #fff;
}

.help-content {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
  overflow: auto;
  font-size: 9px;
  line-height: 1.42;
}

.help-content h4 {
  margin: 8px 0 3px;
  font-size: 9.4px;
  font-weight: 800;
  color: #28435a;
}

.help-content p {
  margin: 4px 0;
}

.help-content ul,
.help-content ol {
  margin: 4px 0 7px 17px;
  padding: 0;
}

.help-content code {
  background: rgba(30, 86, 120, 0.1);
  border: 1px solid rgba(74, 127, 159, 0.22);
  border-radius: 4px;
  padding: 0 4px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.94em;
}

.help-modal-foot {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 8px;
  align-items: center;
}

.help-pager-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}

.help-dot {
  width: 13px;
  min-width: 13px;
  height: 13px;
  border-radius: 6px;
  border: 1px solid #8fb4cf;
  background: linear-gradient(180deg, #eef6fd, #dceaf8);
  padding: 0;
}

.help-dot.active {
  background: linear-gradient(180deg, #53b8dc, #2f86a9);
  border-color: #2f8bb3;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(5, 15, 26, 0.08);
}

.tour-spotlight {
  position: fixed;
  z-index: 2205;
  border-radius: 10px;
  border: 2px solid #4eb4d8;
  background: transparent;
  pointer-events: none;
  box-shadow:
    0 0 0 9999px rgba(5, 15, 26, 0.58),
    0 0 24px rgba(78, 180, 216, 0.48),
    inset 0 0 0 1px rgba(190, 236, 255, 0.55);
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.tour-card {
  position: fixed;
  z-index: 2210;
  right: 14px;
  bottom: 14px;
  width: min(440px, calc(100vw - 28px));
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(251, 254, 255, 0.99), rgba(243, 249, 255, 0.985));
  box-shadow: 0 20px 50px rgba(10, 27, 42, 0.34);
  padding: 10px;
}

.tour-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.tour-head h3 {
  font-size: 10px;
}

.tour-body {
  font-size: 8.8px;
  line-height: 1.4;
}

.tour-body p {
  margin: 0;
}

.tour-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tour-foot button:last-child {
  margin-left: auto;
}

.tour-step-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 1 1 140px;
  flex-wrap: wrap;
}

.tour-step-dot {
  width: 12px;
  min-width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid #8fb4cf;
  background: linear-gradient(180deg, #eef6fd, #dceaf8);
  padding: 0;
}

.tour-step-dot.active {
  background: linear-gradient(180deg, #53b8dc, #2f86a9);
  border-color: #2f8bb3;
}

.tour-step-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.tour-body ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.tour-body li + li {
  margin-top: 4px;
}

.help-article-nav,
.help-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.help-inline-btn {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 8px;
  background: linear-gradient(180deg, #f9fcff, #e9f2fb);
  color: #244960;
  font-size: 8px;
  font-weight: 700;
}

.help-content h5 {
  margin: 8px 0 3px;
  font-size: 8.6px;
  font-weight: 800;
  color: #34536c;
}

.tour-target {
  position: relative;
  z-index: 2208 !important;
  outline: 2px solid #4eb4d8;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(78, 180, 216, 0.25), 0 0 24px rgba(66, 148, 184, 0.35);
  border-radius: 8px;
  animation: tourPulse 1.2s ease-in-out infinite;
}

@keyframes tourPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(78, 180, 216, 0.2), 0 0 18px rgba(66, 148, 184, 0.3);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(78, 180, 216, 0.28), 0 0 26px rgba(66, 148, 184, 0.42);
  }
}

body.floor-editor-modal-open {
  overflow: hidden;
}

body.help-modal-open {
  overflow: hidden;
}

body.tour-open {
  overflow: hidden;
}

body.floor-editor-modal-open #floorEditorPanel {
  position: fixed;
  z-index: 2010;
  inset: 18px;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 26px 70px rgba(9, 24, 37, 0.35);
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.995), rgba(243, 249, 255, 0.985));
  overflow: auto;
  animation: editorModalIn 0.16s ease-out;
}

body.floor-editor-modal-open #floorEditorPanel #floorSvg {
  width: 100%;
  height: 100%;
  min-height: 520px;
  max-height: calc(100vh - 250px);
  display: block;
  margin: 0 auto;
}

body.floor-editor-modal-open .layout {
  pointer-events: none;
  user-select: none;
}

body.floor-editor-modal-open #floorEditorPanel {
  pointer-events: auto;
}

body.floor-editor-modal-open #floorEditorCanvasSlot {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  background: color-mix(in srgb, var(--panel) 92%, #f5fbff);
}

@keyframes editorModalIn {
  from {
    transform: translateY(10px) scale(0.99);
    opacity: 0.35;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.nudge-grid label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nudge-grid input {
  width: 60px;
}

.tool-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
}

.tool-btn.active {
  background: linear-gradient(180deg, #def5ff, #c6e8fb);
  border-color: #79afd4;
}

.editor-icon-btn {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  color: #294866;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 4px rgba(21, 37, 53, 0.08);
}

.editor-icon-btn.danger {
  color: #8f3030;
}

.editor-icon-btn:hover,
.icon-tab-btn:hover,
.icon-tool-btn:hover {
  transform: translateY(-1px);
}

#draftStatus {
  font-weight: 700;
  color: #23415d;
  margin-right: 4px;
}

.status-chip {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 5px;
  background: linear-gradient(180deg, #f9fcff, #edf4fb);
  font-size: 6pt;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3b5368;
  min-height: 15px;
  line-height: 1.05;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 1px rgba(20, 38, 55, 0.06);
}

button.status-chip {
  cursor: pointer;
  transition: all 0.16s ease;
  min-width: 0;
  padding: 0 5px;
}

button.status-chip:hover {
  border-color: #7ea5c8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 2px rgba(85, 139, 185, 0.14);
}

button.status-chip.active {
  border-color: #2f8bb3;
  color: #fff;
  background: linear-gradient(180deg, #53b8dc, #2f86a9);
  box-shadow: 0 0 0 2px rgba(63, 156, 195, 0.18), 0 1px 3px rgba(27, 76, 98, 0.28);
}

button.status-chip:active {
  transform: translateY(0.5px);
}

#floorSvg {
  width: 100%;
  min-height: 390px;
  height: 390px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  display: block;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.lot-label-main {
  font-size: 7.2px;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  fill: #172636;
  text-anchor: middle;
}

.lot-label-group {
  pointer-events: none;
}

.lot-label-bg {
  fill: rgba(255, 255, 255, 0.9);
  stroke: rgba(41, 63, 86, 0.34);
  stroke-width: 1;
}

.lot-label-group.overlap .lot-label-bg {
  fill: rgba(255, 250, 238, 0.96);
  stroke: rgba(124, 91, 27, 0.62);
  stroke-width: 1.2;
}

.lot-label-group.hovered .lot-label-bg {
  fill: rgba(235, 247, 255, 0.98);
  stroke: rgba(17, 84, 145, 0.78);
  stroke-width: 1.5;
  filter: drop-shadow(0 4px 10px rgba(24, 83, 145, 0.22));
}

.lot-label-sub {
  font-size: 6.4px;
  font-weight: 600;
  fill: #334d66;
  text-anchor: middle;
}

.lot-label-power {
  font-size: 8px;
  font-weight: 800;
  fill: #c03232;
  text-anchor: middle;
}

.column-dot {
  fill: #111;
  opacity: 0.88;
}

.lot-block {
  stroke: #11314b;
  stroke-width: 1;
}

.lot-block.overlap {
  filter: saturate(1.08);
}

.lot-block-outline-shadow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 4.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.lot-block-outline {
  fill: none;
  stroke-width: 2.3;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.lot-block-outline.overlap {
  stroke-width: 2.8;
}

.lot-hover-outline-shadow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 8;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}

.lot-hover-outline {
  fill: none;
  stroke: #ff2b2b;
  stroke-width: 4.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 43, 43, 0.45));
}

.lot-block.hovered {
  filter: saturate(1.18) brightness(1.02);
}

.lot-block-outline-shadow.hovered {
  stroke: rgba(255, 255, 255, 1);
  stroke-width: 6.4;
}

.lot-block-outline.hovered {
  stroke-width: 3.8;
}

.lot-block.conflict {
  stroke: #a12f2f;
  stroke-width: 2.7;
  stroke-dasharray: 6 4;
}

#lotsTable tr.is-hover-linked td {
  background: rgba(111, 179, 235, 0.16);
}

.free-block {
  cursor: pointer;
}

.free-block.selectable {
  fill: rgba(186, 205, 224, 0.52);
  stroke: #7290ad;
  stroke-width: 1;
}

.free-block.selected {
  fill: rgba(47, 153, 111, 0.76);
  stroke: #1a6f4f;
  stroke-width: 2;
}

.editor-block {
  fill: rgba(72, 142, 194, 0.16);
  stroke: #25587e;
  stroke-width: 1.1;
  cursor: pointer;
}

.editor-block.active {
  fill: rgba(70, 171, 106, 0.24);
  stroke: #24733d;
  stroke-width: 1.6;
}

.editor-grid-line {
  stroke: #8da8bf;
  stroke-width: 0.9;
  stroke-dasharray: 4 4;
  opacity: 0.8;
}

.editor-node {
  fill: #0f2b41;
  opacity: 0.45;
}

.editor-handle {
  fill: #fff;
  stroke: #0f5e8f;
  stroke-width: 1.4;
  cursor: grab;
}

.editor-handle.dragging {
  cursor: grabbing;
  fill: #e2f3ff;
  stroke: #0e78b5;
}

.markup {
  margin-top: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.7);
}

.markup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.markup h3 {
  font-size: 6.5px;
  margin: 0;
}

.markup-collapse-btn {
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 5px;
  padding: 0;
  line-height: 1;
  font-size: 10px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fff, #edf4fb);
  color: #28435e;
}

.markup-body {
  margin-top: 4px;
}

.markup.collapsed {
  padding-top: 3px;
  padding-bottom: 3px;
  border-style: solid;
  min-height: 16px;
}

.markup.collapsed .markup-body {
  display: none;
}

.markup.collapsed .markup-collapse-btn {
  transform: rotate(-90deg);
}

.markup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 6px;
  margin: 5px 0;
}

.markup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
}

.markup-actions {
  justify-content: flex-start;
  gap: 5px;
}

.markup-grid label,
.markup-row label {
  font-size: 8px;
  color: var(--text-soft);
  gap: 4px;
}

.markup-row .field {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.markup-row .checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

input,
select {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 4px;
  font: inherit;
  background: var(--panel-strong);
  color: var(--text);
}

.density-switch select {
  min-width: 108px;
}

.pretty-check {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid #95abc2;
  background: linear-gradient(180deg, #f7fbff, #dce8f4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 1px 2px rgba(17, 38, 57, 0.14);
  position: relative;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.16s ease;
  flex: 0 0 auto;
}

.pretty-check:hover {
  border-color: #7ea5c8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 2px rgba(85, 139, 185, 0.14);
}

.pretty-check::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #edf3fa);
  box-shadow: 0 1px 2px rgba(26, 43, 62, 0.24);
  transition: transform 0.16s ease;
}

.pretty-check:checked {
  border-color: #2f8bb3;
  background: linear-gradient(180deg, #5abfe1, #2f86a9);
  box-shadow: 0 0 0 2px rgba(63, 156, 195, 0.22), 0 1px 3px rgba(27, 76, 98, 0.36);
}

.pretty-check:checked::after {
  transform: translateX(11px);
  background: linear-gradient(180deg, #ffffff, #eef6ff);
}

input:focus,
select:focus {
  outline: none;
  border-color: #8db7de;
  box-shadow: 0 0 0 3px rgba(109, 169, 220, 0.18);
}

#createLotBtn,
#saveLotBlocksBtn {
  background: linear-gradient(135deg, #e8f7ef, #dbf2ff);
  border-color: #b9d7ea;
}

#undoSelectionBtn,
#clearSelectionBtn {
  background: var(--panel-strong);
}

.icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 4px rgba(21, 37, 53, 0.08);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #233f5a;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.danger svg {
  stroke: #8f3030;
}

#markupResult {
  margin-top: 5px;
  font-size: 8.8px;
  font-weight: 700;
  color: #1f6a4d;
}

.lot-adjustment-alerts {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
}

.lot-adjustment-alert {
  border: 1px solid #d18d2f;
  background: linear-gradient(180deg, #fff7e8 0%, #fff1d5 100%);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(91, 100, 113, 0.08);
}

.lot-adjustment-alert__title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #7b4b00;
}

.lot-adjustment-alert__body,
.lot-adjustment-alert__meta {
  color: #5c451f;
  margin-bottom: 6px;
}

.lot-adjustment-alert button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #7b4b00;
  color: #fffdf8;
  cursor: pointer;
}

.conflicts {
  margin-top: 6px;
  background: linear-gradient(180deg, rgba(255, 235, 235, 0.92), rgba(255, 223, 223, 0.86));
  border: 1px solid #e59f9f;
  border-radius: 10px;
  padding: 6px 8px;
}

.conflicts h3 {
  font-size: 6.5px;
  margin-bottom: 4px;
  color: #8e2f2f;
}

.conflicts ul {
  margin: 0;
  padding-left: 18px;
  font-size: 8.8px;
  color: #7a2a2a;
}

.section-params {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  padding: 6px 8px;
}

.section-params h3 {
  font-size: 6.5px;
  margin-bottom: 4px;
}

#sectionParams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
}

.section-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 5px 6px;
}

.section-card .code {
  font-size: 8.8px;
  font-weight: 800;
}

.section-card .line {
  font-size: 8px;
  color: var(--text-soft);
}

.section-card .power {
  color: #c03232;
  font-weight: 800;
}

.builder-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.builder-geo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: end;
}

.builder-geo-actions button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  color: var(--text);
  cursor: pointer;
}

.builder-map-card {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
}

.builder-map-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.builder-map {
  width: 100%;
  height: 250px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.builder-formula-card {
  background: linear-gradient(180deg, rgba(231, 245, 255, 0.92), rgba(220, 238, 250, 0.88));
}

.builder-formula-text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  line-height: 1.45;
  color: #19455f;
  font-weight: 700;
}

.builder-formula-text strong {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent-2);
}

.builder-validation-list {
  margin: 8px 0 0 18px;
  color: var(--danger);
  font-weight: 700;
}

.hint.error-text {
  color: var(--danger);
  font-weight: 700;
}

.hint.ok-text {
  color: var(--ok);
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-weight: 700;
}

.section-card.status-free {
  background: color-mix(in srgb, var(--free) 34%, white);
  border-color: color-mix(in srgb, var(--free) 45%, #b8c8d8);
}

.section-card.status-negotiation {
  background: color-mix(in srgb, var(--negotiation) 34%, white);
  border-color: color-mix(in srgb, var(--negotiation) 45%, #b8c8d8);
}

.section-card.status-negotiation-final {
  background: color-mix(in srgb, var(--negotiation-final) 34%, white);
  border-color: color-mix(in srgb, var(--negotiation-final) 45%, #b8c8d8);
}

.section-card.status-contracting {
  background: color-mix(in srgb, var(--contracting) 34%, white);
  border-color: color-mix(in srgb, var(--contracting) 45%, #b8c8d8);
}

.section-card.status-sold {
  background: color-mix(in srgb, var(--sold) 30%, white);
  border-color: color-mix(in srgb, var(--sold) 45%, #b8c8d8);
}

.section-card.status-sold-ds {
  background: color-mix(in srgb, var(--sold-ds) 28%, white);
  border-color: color-mix(in srgb, var(--sold-ds) 50%, #b8c8d8);
}

.status-pill.status-free {
  background: color-mix(in srgb, var(--free) 38%, white);
  border-color: color-mix(in srgb, var(--free) 55%, #8fa4b9);
}

.status-pill.status-negotiation {
  background: color-mix(in srgb, var(--negotiation) 38%, white);
  border-color: color-mix(in srgb, var(--negotiation) 55%, #8fa4b9);
}

.status-pill.status-negotiation-final {
  background: color-mix(in srgb, var(--negotiation-final) 38%, white);
  border-color: color-mix(in srgb, var(--negotiation-final) 55%, #8fa4b9);
}

.status-pill.status-contracting {
  background: color-mix(in srgb, var(--contracting) 38%, white);
  border-color: color-mix(in srgb, var(--contracting) 55%, #8fa4b9);
}

.status-pill.status-sold {
  background: color-mix(in srgb, var(--sold) 34%, white);
  border-color: color-mix(in srgb, var(--sold) 55%, #8fa4b9);
}

.status-pill.status-sold-ds {
  background: color-mix(in srgb, var(--sold-ds) 30%, white);
  border-color: color-mix(in srgb, var(--sold-ds) 55%, #8fa4b9);
  color: #1f2a36;
}

.section-card.is-active {
  box-shadow: 0 0 0 2px rgba(205, 39, 39, 0.22);
  border-color: rgba(205, 39, 39, 0.54);
}

.lot-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(760px, calc(100vw - 36px));
  z-index: 2110;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(244, 248, 252, 0.965));
  box-shadow: 0 24px 60px rgba(18, 31, 44, 0.22);
  overflow: hidden;
}

.lot-drawer__header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 252, 0.96));
  border-bottom: 1px solid var(--line);
}

.lot-drawer__header-main,
.lot-drawer__summary,
.lot-drawer__actions,
.lot-drawer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lot-drawer__header-main {
  justify-content: space-between;
  align-items: flex-start;
}

.lot-drawer__header h3 {
  margin: 4px 0;
  font-size: 18px;
}

.lot-drawer__eyebrow,
.lot-drawer__subtitle {
  color: var(--text-soft);
  font-size: 11px;
}

.lot-drawer__summary {
  margin-top: 10px;
}

.lot-drawer__summary span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px;
}

.lot-drawer__actions {
  margin-top: 12px;
}

.lot-drawer__actions button,
.lot-drawer__actions select,
.lot-drawer__alerts button,
.lot-drawer__nav button,
.lot-conflict-card__actions button,
.lot-chip-list button,
.lot-drawer__close {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #eef4fb);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

.lot-drawer__close {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
}

.lot-drawer__action {
  display: grid;
  gap: 4px;
  font-size: 10px;
  color: var(--text-soft);
}

.lot-drawer__alerts {
  display: grid;
  gap: 10px;
  padding: 12px 18px 0;
}

.lot-drawer__alert {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
}

.lot-drawer__alert.warn {
  background: linear-gradient(180deg, #fff6df, #ffedc6);
  border-color: #d9ae54;
}

.lot-drawer__alert.danger {
  background: linear-gradient(180deg, #ffefef, #ffdcdc);
  border-color: #d88f8f;
}

.lot-drawer__nav {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}

.lot-drawer__nav button.active {
  background: linear-gradient(180deg, #1677a6, #1291b4);
  color: #fff;
  border-color: transparent;
}

.lot-drawer__content {
  overflow: auto;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.lot-drawer__section {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  padding: 14px;
}

.lot-drawer__section--wide {
  grid-column: 1 / -1;
}

.lot-drawer__section h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.lot-kv {
  display: grid;
  gap: 8px;
  margin: 0;
}

.lot-kv__row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.lot-kv__row dt {
  color: var(--text-soft);
}

.lot-kv__row dd {
  margin: 0;
  font-weight: 600;
}

.lot-mini-plan {
  width: 100%;
  height: 180px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #f4f8fb;
  border: 1px solid var(--line);
}

.lot-mini-plan polygon {
  fill: rgba(22, 119, 166, 0.2);
  stroke: #d52323;
  stroke-width: 2;
}

.lot-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lot-chip-list span,
.lot-chip-list button {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(237, 244, 250, 0.95);
  border: 1px solid var(--line);
  font-size: 11px;
}

.lot-drawer__subblock {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.lot-drawer__subblock ul,
.lot-history-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.lot-drawer__empty {
  color: var(--text-soft);
}

.lot-drawer__conflicts {
  display: grid;
  gap: 10px;
}

.lot-conflict-card {
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.lot-conflict-card.severity-high,
.lot-conflict-card.severity-critical {
  border-color: #d78484;
  background: rgba(255, 244, 244, 0.95);
}

.lot-conflict-card__head,
.lot-conflict-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.lot-feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lot-checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 6px;
}

.lot-checklist li.ok {
  color: var(--ok);
}

.lot-checklist li.fail {
  color: var(--danger);
}

#lotsTable tr.is-selected-row td {
  box-shadow: inset 0 0 0 1px rgba(205, 39, 39, 0.5);
}

.lots-table-wrap {
  margin-top: 6px;
  overflow: auto;
  max-height: 320px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

#lotsTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.8px;
  table-layout: auto;
}

#lotsTable th,
#lotsTable td {
  border-bottom: 1px solid var(--line);
  padding: 3px 4px;
  text-align: left;
  white-space: nowrap;
}

#lotsTable td input[data-role="feed"] {
  display: block;
  margin: 0 auto;
}

#lotsTable th {
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f8fbff, #edf4fb);
  color: #344e63;
  font-weight: 800;
  z-index: 6;
  font-size: 10px;
  line-height: 1.2;
  border-bottom: 1px solid #bfd2e7;
  box-shadow: 0 1px 0 rgba(173, 193, 213, 0.9);
}

body.theme-dark #viewer3d {
  background: linear-gradient(165deg, #152433, #172a3d 54%, #173127);
}

body.theme-dark .topbar {
  background: linear-gradient(130deg, rgba(17, 29, 41, 0.92), rgba(19, 32, 48, 0.88));
}

body.theme-dark .topbar button {
  box-shadow: 0 8px 18px rgba(18, 96, 129, 0.36);
}

body.theme-dark #floorSvg {
  background: linear-gradient(180deg, #162634, #152232);
}

body.theme-dark .tab-btn,
body.theme-dark .tool-btn,
body.theme-dark .status-chip,
body.theme-dark .icon-btn,
body.theme-dark .markup-collapse-btn {
  background: linear-gradient(180deg, #1b2c3e, #182838);
  border-color: #3e5670;
  color: #d9e7f5;
}

body.theme-dark .tab-btn.active,
body.theme-dark button.status-chip.active {
  background: linear-gradient(180deg, #3aa8cf, #2b7ea7);
  border-color: #44a3ca;
  color: #fff;
}

body.theme-dark #lotsTable th {
  background: linear-gradient(180deg, #1a2e43, #17293b);
  color: #dce9f7;
  border-bottom-color: #3a5672;
  box-shadow: 0 1px 0 rgba(50, 82, 112, 0.9);
}

body.theme-dark #lotsTable tr:hover td {
  background: rgba(46, 76, 106, 0.42);
}

body.theme-dark .lots-table-wrap,
body.theme-dark .conflicts,
body.theme-dark .section-params,
body.theme-dark .floor-editor-panel,
body.theme-dark .facade-floors,
body.theme-dark .markup,
body.theme-dark .builder-map-card {
  background: rgba(19, 30, 42, 0.78);
}

body.theme-dark .conflicts {
  background: linear-gradient(180deg, rgba(92, 34, 34, 0.76), rgba(74, 27, 27, 0.72));
  border-color: #9c4d4d;
}

body.theme-dark .conflicts h3,
body.theme-dark .conflicts ul {
  color: #ffd0d0;
}

body.theme-dark .section-card {
  background: rgba(23, 36, 51, 0.95);
}

body.theme-dark .section-card .line,
body.theme-dark .conflicts ul,
body.theme-dark .controls,
body.theme-dark .hint {
  color: #b8cbe0;
}

body.theme-dark .lot-label-bg {
  fill: rgba(16, 27, 39, 0.92);
  stroke: rgba(150, 176, 204, 0.42);
}

body.theme-dark .lot-label-group.overlap .lot-label-bg {
  fill: rgba(56, 42, 16, 0.94);
  stroke: rgba(243, 193, 92, 0.62);
}

body.theme-dark .lot-label-group.hovered .lot-label-bg {
  fill: rgba(22, 46, 72, 0.96);
  stroke: rgba(104, 184, 255, 0.84);
}

body.theme-dark #lotsTable tr.is-hover-linked td {
  background: rgba(66, 124, 180, 0.3);
}

body.theme-dark #lotsTable tr.status-free td {
  background: color-mix(in srgb, var(--free) 34%, #162432);
}

body.theme-dark #lotsTable tr.status-negotiation td {
  background: color-mix(in srgb, var(--negotiation) 34%, #162432);
}

body.theme-dark #lotsTable tr.status-negotiation-final td {
  background: color-mix(in srgb, var(--negotiation-final) 34%, #162432);
}

body.theme-dark #lotsTable tr.status-contracting td {
  background: color-mix(in srgb, var(--contracting) 34%, #162432);
}

body.theme-dark #lotsTable tr.status-sold td {
  background: color-mix(in srgb, var(--sold) 30%, #162432);
}

body.theme-dark #lotsTable tr.status-sold-ds td {
  background: color-mix(in srgb, var(--sold-ds) 28%, #162432);
}

body.theme-dark .section-card.status-free {
  background: color-mix(in srgb, var(--free) 32%, #1a2b3b);
}

body.theme-dark .section-card.status-negotiation {
  background: color-mix(in srgb, var(--negotiation) 32%, #1a2b3b);
}

body.theme-dark .section-card.status-negotiation-final {
  background: color-mix(in srgb, var(--negotiation-final) 32%, #1a2b3b);
}

body.theme-dark .section-card.status-contracting {
  background: color-mix(in srgb, var(--contracting) 32%, #1a2b3b);
}

body.theme-dark .section-card.status-sold {
  background: color-mix(in srgb, var(--sold) 28%, #1a2b3b);
}

body.theme-dark .section-card.status-sold-ds {
  background: color-mix(in srgb, var(--sold-ds) 24%, #1a2b3b);
}

body.theme-dark .status-pill {
  color: #e8f2fb;
}

body.theme-dark .status-pill.status-free {
  background: color-mix(in srgb, var(--free) 40%, #1a2b3b);
  border-color: color-mix(in srgb, var(--free) 55%, #3a5572);
}

body.theme-dark .status-pill.status-negotiation {
  background: color-mix(in srgb, var(--negotiation) 40%, #1a2b3b);
  border-color: color-mix(in srgb, var(--negotiation) 55%, #3a5572);
}

body.theme-dark .status-pill.status-negotiation-final {
  background: color-mix(in srgb, var(--negotiation-final) 40%, #1a2b3b);
  border-color: color-mix(in srgb, var(--negotiation-final) 55%, #3a5572);
}

body.theme-dark .status-pill.status-contracting {
  background: color-mix(in srgb, var(--contracting) 40%, #1a2b3b);
  border-color: color-mix(in srgb, var(--contracting) 55%, #3a5572);
}

body.theme-dark .status-pill.status-sold {
  background: color-mix(in srgb, var(--sold) 36%, #1a2b3b);
  border-color: color-mix(in srgb, var(--sold) 55%, #3a5572);
}

body.theme-dark .status-pill.status-sold-ds {
  background: color-mix(in srgb, var(--sold-ds) 32%, #1a2b3b);
  border-color: color-mix(in srgb, var(--sold-ds) 55%, #3a5572);
}

body.theme-dark .lot-drawer {
  background: linear-gradient(180deg, rgba(18, 25, 34, 0.98), rgba(23, 31, 42, 0.96));
}

body.theme-dark .lot-drawer__header,
body.theme-dark .lot-drawer__section,
body.theme-dark .lot-conflict-card {
  background: rgba(20, 28, 38, 0.9);
}

body.theme-dark .lot-drawer__summary span,
body.theme-dark .lot-chip-list span,
body.theme-dark .lot-chip-list button,
body.theme-dark .lot-mini-plan {
  background: rgba(26, 35, 47, 0.92);
}

body.theme-dark #lotsTable tr.is-selected-row td {
  box-shadow: inset 0 0 0 1px rgba(255, 108, 108, 0.48);
}

body.theme-dark .editor-backdrop {
  background: rgba(3, 8, 15, 0.66);
}

body.theme-dark .help-backdrop {
  background: rgba(2, 7, 13, 0.74);
}

body.theme-dark .tour-backdrop {
  background: rgba(2, 8, 14, 0.1);
}

body.theme-dark .tour-spotlight {
  border-color: #47b0d9;
  box-shadow:
    0 0 0 9999px rgba(3, 10, 16, 0.64),
    0 0 26px rgba(71, 176, 217, 0.46),
    inset 0 0 0 1px rgba(172, 228, 255, 0.52);
}

body.theme-dark .tour-card {
  background: linear-gradient(180deg, rgba(21, 34, 48, 0.995), rgba(18, 30, 43, 0.985));
  box-shadow: 0 24px 60px rgba(0, 8, 16, 0.62);
}

body.theme-dark .tour-target {
  outline-color: #47b0d9;
  box-shadow: 0 0 0 4px rgba(71, 176, 217, 0.24), 0 0 26px rgba(68, 145, 184, 0.36);
}

body.theme-dark .help-modal {
  background: linear-gradient(180deg, rgba(21, 34, 48, 0.995), rgba(18, 30, 43, 0.985));
  box-shadow: 0 28px 74px rgba(0, 8, 16, 0.6);
}

body.theme-dark .help-content,
body.theme-dark .help-toc {
  background: rgba(20, 31, 44, 0.84);
  border-color: #36506a;
}

body.theme-dark .help-content h4 {
  color: #cce4f8;
}

body.theme-dark .help-content code {
  background: rgba(67, 129, 171, 0.18);
  border-color: rgba(106, 165, 204, 0.36);
}

body.theme-dark .help-inline-btn,
body.theme-dark .tour-step-dot {
  background: linear-gradient(180deg, #1c2e42, #17293c);
  border-color: #3c5672;
  color: #dce9f7;
}

body.theme-dark .help-toc-item {
  background: linear-gradient(180deg, #1c2e42, #17293c);
  border-color: #3c5672;
  color: #dce9f7;
}

body.theme-dark .help-toc-item.active,
body.theme-dark .help-dot.active,
body.theme-dark .tour-step-dot.active {
  background: linear-gradient(180deg, #3aa8cf, #2b7ea7);
  border-color: #44a3ca;
}

body.theme-dark #closeHelpModalBtn {
  background: linear-gradient(180deg, #1d3246, #1a2c3e);
  border-color: #3f5b77;
  color: #d8e9f8;
}

body.theme-dark.floor-editor-modal-open #floorEditorPanel {
  background: linear-gradient(180deg, rgba(21, 34, 48, 0.995), rgba(18, 30, 43, 0.985));
  box-shadow: 0 26px 70px rgba(0, 7, 14, 0.55);
}

body.theme-dark.floor-editor-modal-open #floorEditorCanvasSlot {
  background: color-mix(in srgb, #132131 88%, #0f1b28);
  border-color: #2d4861;
}

body.theme-dark #closeFloorEditorModalBtn {
  background: linear-gradient(180deg, #1d3246, #1a2c3e);
  border-color: #3f5b77;
  color: #d8e9f8;
}

#lotsTable tr:hover td {
  background: rgba(222, 236, 249, 0.35);
}

#lotsTable tr.status-free td {
  background: color-mix(in srgb, var(--free) 28%, white);
}

#lotsTable tr.status-negotiation td {
  background: color-mix(in srgb, var(--negotiation) 28%, white);
}

#lotsTable tr.status-negotiation-final td {
  background: color-mix(in srgb, var(--negotiation-final) 28%, white);
}

#lotsTable tr.status-contracting td {
  background: color-mix(in srgb, var(--contracting) 28%, white);
}

#lotsTable tr.status-sold td {
  background: color-mix(in srgb, var(--sold) 24%, white);
}

#lotsTable tr.status-sold-ds td {
  background: color-mix(in srgb, var(--sold-ds) 22%, white);
}

.drag-select-box {
  fill: rgba(20, 98, 138, 0.12);
  stroke: #14628a;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }

  #viewer3d {
    height: 320px;
  }

  #floorSvg {
    min-height: 320px;
    height: 320px;
  }

  .markup-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .help-modal-main {
    grid-template-columns: 1fr;
  }

  .lot-drawer {
    top: 12px;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }

  .lot-drawer__content {
    grid-template-columns: 1fr;
  }

  .lot-kv__row {
    grid-template-columns: 1fr;
  }

  .help-toc {
    max-height: 150px;
  }

  .help-modal-foot {
    grid-template-columns: 1fr 1fr;
  }

  .help-pager-dots {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar h1 {
    width: 100%;
    font-size: 8px;
  }

  .markup-grid {
    grid-template-columns: 1fr;
  }

  #floorSvg {
    min-height: 320px;
    height: 320px;
  }
}

body.density-normal {
  font-size: 13px;
}

body.density-normal h1 {
  font-size: 16px;
}

body.density-normal h2 {
  font-size: 14px;
}

body.density-normal h3 {
  font-size: 13px;
}

body.density-normal .topbar {
  gap: 14px;
  padding: 14px 20px;
}

body.density-normal .topbar button,
body.density-normal button {
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
}

body.density-normal .help-modal-head h2 {
  font-size: 18px;
}

body.density-normal .help-content {
  font-size: 12px;
}

body.density-normal .help-content h4 {
  font-size: 14px;
}

body.density-normal .tour-head h3 {
  font-size: 14px;
}

body.density-normal .tour-body {
  font-size: 12px;
}

body.density-normal #jobResult,
body.density-normal .hint,
body.density-normal .controls,
body.density-normal .quick-select strong,
body.density-normal .three-controls,
body.density-normal .markup-grid label,
body.density-normal .markup-row label,
body.density-normal #markupResult,
body.density-normal .conflicts ul,
body.density-normal #lotsTable {
  font-size: 12px;
}

body.density-normal .pane {
  padding: 12px;
  border-radius: 16px;
}

body.density-normal .markup-collapse-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  font-size: 12px;
}

body.density-normal .status-chip {
  min-height: 28px;
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 9px;
}

body.density-normal .layout {
  gap: 14px;
  padding: 14px;
}

body.density-normal #viewer3d {
  height: 470px;
}

body.density-normal #floorSvg {
  min-height: 470px;
  height: 470px;
}

body.density-normal input,
body.density-normal select {
  border-radius: 8px;
  padding: 6px 8px;
}

body.density-normal #lotsTable th,
body.density-normal #lotsTable td {
  padding: 7px 8px;
}

body.density-ultra {
  font-size: 9px;
}

body.density-ultra h1 {
  font-size: 7px;
}

body.density-ultra h2 {
  font-size: 6px;
}

body.density-ultra h3 {
  font-size: 5.6px;
}

body.density-ultra .topbar {
  gap: 6px;
  padding: 6px 10px;
}

body.density-ultra .topbar button,
body.density-ultra button {
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 7px;
}

body.density-ultra .help-modal {
  inset: 8px;
  padding: 7px;
}

body.density-ultra .help-modal-head h2 {
  font-size: 8px;
}

body.density-ultra .help-content {
  font-size: 7.2px;
  padding: 7px;
}

body.density-ultra .help-content h4 {
  font-size: 7.6px;
}

body.density-ultra .tour-card {
  right: 8px;
  bottom: 8px;
  width: min(380px, calc(100vw - 16px));
  padding: 7px;
}

body.density-ultra .tour-head h3 {
  font-size: 7.8px;
}

body.density-ultra .tour-body {
  font-size: 7.2px;
}

body.density-ultra .layout {
  gap: 6px;
  padding: 6px;
}

body.density-ultra .pane {
  padding: 6px;
  border-radius: 9px;
}

body.density-ultra .hint,
body.density-ultra .controls,
body.density-ultra .quick-select strong,
body.density-ultra .three-controls,
body.density-ultra .markup-grid label,
body.density-ultra .markup-row label,
body.density-ultra #jobResult,
body.density-ultra #markupResult,
body.density-ultra .conflicts ul,
body.density-ultra #lotsTable {
  font-size: 7.2px;
}

body.density-ultra .status-chip {
  min-height: 18px;
  font-size: 7px;
  padding: 1px 7px;
  border-radius: 6px;
}

body.density-ultra .markup-collapse-btn {
  width: 16px;
  min-width: 16px;
  height: 16px;
  font-size: 9px;
}

body.density-ultra #viewer3d {
  height: 300px;
}

body.density-ultra #floorSvg {
  min-height: 300px;
  height: 300px;
}

body.density-ultra input,
body.density-ultra select {
  border-radius: 3px;
  padding: 1px 3px;
}

body.density-ultra #lotsTable th,
body.density-ultra #lotsTable td {
  padding: 3px 4px;
}

body.density-ultra #lotsTable {
  font-size: 9px;
}

body.density-ultra #lotsTable th {
  font-size: 9.5px;
}

body.density-ultra .icon-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 8px;
}

body.density-ultra .icon-btn svg {
  width: 18px;
  height: 18px;
}

body.density-ultra .pretty-check {
  width: 22px;
  height: 13px;
}

body.density-ultra .pretty-check::after {
  width: 9px;
  height: 9px;
}

body.density-ultra .pretty-check:checked::after {
  transform: translateX(9px);
}

body.density-normal .pretty-check {
  width: 30px;
  height: 18px;
}

body.density-normal .pretty-check::after {
  width: 14px;
  height: 14px;
}

body.density-normal .pretty-check:checked::after {
  transform: translateX(12px);
}

body.density-normal .icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}

body.density-normal .icon-btn svg {
  width: 24px;
  height: 24px;
}
