@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/montserrat-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/montserrat-600.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./assets/fonts/montserrat-700.woff2") format("woff2");
}

:root {
  /* Native palette values measured from the live UFARMS theme CSS on ufarms.ru. */
  --bg: #f8f8f8;
  --panel: #ffffff;
  --panel-soft: #f8f8f8;
  --panel-strong: #ffffff;
  --line: #ececec;
  --line-strong: #d5d5d5;
  --text: #333333;
  --muted: #555555;
  --muted-2: #999999;
  --green: #0aa360;
  --green-deep: #099f5d;
  --green-soft: #0aa3601a;
  --lime: #55b970;
  --amber: #d8a20e;
  --blue: #3b8fd6;
  --danger: #d64545;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(31, 49, 40, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="range"],
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible,
iframe:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

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

.app-shell {
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr);
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr) minmax(160px, 330px);
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 18px rgba(31, 49, 40, 0.06);
  backdrop-filter: blur(18px);
}

.brand {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 22px;
  color: var(--text);
  text-decoration: none;
  border-right: 1px solid var(--line);
}

.brand-logo {
  display: block;
  width: auto;
  height: 50px;
}

.topbar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.025em;
}

.topbar-flow {
  min-width: 0;
  margin-left: 8px;
  padding-left: 16px;
  overflow: hidden;
  border-left: 1px solid var(--line-strong);
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(73, 222, 135, 0.09);
}

.icon-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 18px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: 160ms ease;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.icon-button svg,
.button svg,
.fit-button svg,
.canvas-hint svg,
.commercial-note svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(292px, 330px) minmax(0, 1fr) minmax(310px, 354px);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  height: calc(100vh - 70px);
}

.panel {
  min-width: 0;
  padding: 22px;
  background: var(--panel);
  overflow-y: auto;
  scrollbar-color: rgba(138, 183, 159, 0.22) transparent;
  scrollbar-width: thin;
}

.config-panel {
  border-right: 1px solid var(--line);
}

.summary-panel {
  overflow-x: hidden;
  border-left: 1px solid var(--line);
  background: var(--panel-soft);
}

.summary-panel > * {
  min-width: 0;
}

.panel-heading {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 22px;
}

.panel-heading.compact {
  margin-bottom: 18px;
}

.step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(73, 222, 135, 0.28);
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.panel-heading h1,
.panel-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.control-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-label span,
.section-kicker {
  color: #dce9e2;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.015em;
}

.section-label small {
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

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

.layout-control-section .section-label {
  margin-bottom: 1px;
}

.orientation-toggle {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(73, 222, 135, 0.34);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(19, 157, 94, 0.2), rgba(255, 255, 255, 0.025));
  color: #173326;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.orientation-toggle:hover {
  border-color: rgba(73, 222, 135, 0.62);
  background: linear-gradient(135deg, rgba(19, 157, 94, 0.3), rgba(255, 255, 255, 0.04));
}

.orientation-toggle:active {
  transform: translateY(1px);
}

.orientation-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.orientation-toggle svg {
  width: 34px;
  height: 34px;
  padding: 7px;
  border-radius: 10px;
  background: var(--green-deep);
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.orientation-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.orientation-toggle b {
  color: #173326;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.orientation-toggle small {
  color: #66766e;
  font-size: 9px;
  line-height: 1.35;
}

.technical-aisle-field {
  margin-top: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.technical-aisle-toggle-row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.technical-aisle-toggle-row .section-kicker {
  color: #173326;
}

.technical-aisle-field.active,
.technical-aisle-toggle-row:has(input:checked) {
  border-color: rgba(10, 163, 96, 0.42);
  background: rgba(10, 163, 96, 0.06);
}

.number-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.field-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.field-heading small {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 550;
  white-space: nowrap;
}

.field > span,
.range-field b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.number-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  transition: 160ms ease;
}

.number-wrap:focus-within {
  border-color: rgba(73, 222, 135, 0.5);
  box-shadow: 0 0 0 3px rgba(73, 222, 135, 0.08);
}

.number-wrap input {
  min-width: 0;
  width: 100%;
  padding: 11px 4px 11px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.number-wrap em {
  padding: 0 11px 0 6px;
  color: var(--muted-2);
  font-style: normal;
  font-size: 11px;
}

.dimension-guidance,
.dimension-feedback,
.dimension-accepted {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.4;
}

.dimension-guidance {
  color: var(--muted-2);
}

.dimension-feedback {
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 650;
}

.dimension-feedback[hidden] {
  display: none;
}

.dimension-accepted {
  color: var(--green-deep);
  font-weight: 650;
}

.dimension-accepted[hidden] {
  display: none;
}

.room-preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

.room-preset-row > span {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
}

.room-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.room-presets button {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  min-width: 58px;
  min-height: 36px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  transition: 160ms ease;
}

.room-presets button:hover {
  border-color: rgba(10, 163, 96, 0.38);
  color: var(--green-deep);
}

.room-presets button.active {
  border-color: rgba(10, 163, 96, 0.42);
  background: rgba(10, 163, 96, 0.08);
  color: var(--green-deep);
  box-shadow: inset 0 0 0 1px rgba(10, 163, 96, 0.04);
}

.room-presets b {
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.room-presets small {
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
}

.dimension-feedback.warning {
  border-color: rgba(207, 143, 0, 0.28);
  background: rgba(255, 191, 51, 0.11);
  color: #7a5600;
}

.dimension-feedback.error {
  border-color: rgba(196, 49, 49, 0.28);
  background: rgba(196, 49, 49, 0.08);
  color: #a42a2a;
}

.field.dimension-warning .number-wrap {
  border-color: rgba(207, 143, 0, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 191, 51, 0.08);
}

.field.dimension-error .number-wrap {
  border-color: rgba(196, 49, 49, 0.62);
  box-shadow: 0 0 0 3px rgba(196, 49, 49, 0.08);
}

.tier-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.tier-button {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: baseline;
  column-gap: 7px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  text-align: left;
  transition: 160ms ease;
}

.tier-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.tier-button.active {
  border-color: rgba(73, 222, 135, 0.48);
  background: linear-gradient(145deg, rgba(73, 222, 135, 0.13), rgba(73, 222, 135, 0.055));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(73, 222, 135, 0.05);
}

.tier-button.active::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(73, 222, 135, 0.09);
}

.tier-button strong {
  grid-row: 1 / 3;
  color: currentColor;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.tier-button span {
  font-size: 12px;
  font-weight: 700;
}

.tier-button small {
  color: var(--muted-2);
  font-size: 9px;
}

.tier-slope-hint {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: -4px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(19, 169, 95, 0.18);
  border-radius: 10px;
  background: rgba(19, 169, 95, 0.055);
  color: #3f6754;
  font-size: 9.5px;
  line-height: 1.35;
}

.tier-slope-hint > strong:first-child {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(19, 169, 95, 0.11);
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.select-field {
  margin-top: 10px;
}

select,
.price-fields input {
  width: 100%;
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #10261e;
  color: #e8f0eb;
  font-size: 12px;
}

select:focus,
.price-fields input:focus {
  border-color: rgba(73, 222, 135, 0.45);
}

.range-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.range-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-field output {
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

.range-field small {
  color: var(--muted-2);
  font-size: 9px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 4px 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, var(--green) 0 var(--range-progress, 50%), rgba(255, 255, 255, 0.1) var(--range-progress, 50%) 100%);
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 3px solid #0d2119;
  border-radius: 50%;
  appearance: none;
  background: var(--green);
  box-shadow: 0 0 0 1px rgba(73, 222, 135, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid #0d2119;
  border-radius: 50%;
  background: var(--green);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-row > div {
  display: grid;
  gap: 4px;
}

.toggle-row small {
  color: var(--muted-2);
  font-size: 10px;
}

.switch {
  display: block;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  display: block;
  width: 43px;
  height: 24px;
  border-radius: 999px;
  background: #263b32;
  transition: 180ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #abc0b5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: 180ms ease;
}

.switch input:checked + span {
  background: var(--green-deep);
}

.switch input:checked + span::after {
  left: 22px;
  background: #fff;
}

.solution-controls {
  display: grid;
  gap: 3px;
  max-height: 260px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 240ms ease, opacity 180ms ease, margin 180ms ease;
}

.solution-section.disabled .solution-controls {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
}

.advanced-settings,
.project-specs {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.advanced-settings summary,
.project-specs summary,
.estimate-breakdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  list-style: none;
  cursor: pointer;
}

.advanced-settings summary::-webkit-details-marker,
.project-specs summary::-webkit-details-marker,
.estimate-breakdown summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary > span,
.project-specs summary > span,
.estimate-breakdown summary > span {
  display: grid;
  gap: 3px;
}

.advanced-settings summary b,
.project-specs summary b,
.estimate-breakdown summary b {
  color: #d9e6df;
  font-size: 11px;
}

.advanced-settings summary small,
.project-specs summary small,
.estimate-breakdown summary small {
  color: var(--muted-2);
  font-size: 9px;
}

.advanced-settings summary svg,
.project-specs summary svg,
.estimate-breakdown summary svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  transition: transform 160ms ease;
}

.advanced-settings[open] summary svg,
.project-specs[open] summary svg,
.estimate-breakdown[open] summary svg {
  transform: rotate(180deg);
}

.advanced-settings-body {
  padding: 0 12px 13px;
  border-top: 1px solid var(--line);
}

.advanced-hint {
  margin: 13px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.45;
}

.node-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 13px 0 2px;
}

.node-chip-row span {
  padding: 5px 7px;
  border: 1px solid rgba(76, 185, 221, 0.17);
  border-radius: 7px;
  background: rgba(76, 185, 221, 0.075);
  color: #91d5ea;
  font-size: 9px;
  font-weight: 650;
}

.layout-notice {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(73, 222, 135, 0.14);
  border-radius: 11px;
  background: rgba(73, 222, 135, 0.055);
}

.layout-notice.warning {
  border-color: rgba(246, 197, 87, 0.24);
  background: rgba(246, 197, 87, 0.065);
}

.layout-notice.error {
  border-color: rgba(251, 123, 107, 0.24);
  background: rgba(251, 123, 107, 0.065);
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(73, 222, 135, 0.14);
  color: var(--green);
  font-weight: 800;
}

.warning .notice-icon { background: rgba(246, 197, 87, 0.13); color: var(--amber); }
.error .notice-icon { background: rgba(251, 123, 107, 0.13); color: var(--danger); }

.layout-notice div {
  display: grid;
  gap: 2px;
}

.layout-notice strong {
  font-size: 10px;
}

.layout-notice small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(33, 104, 70, 0.16), transparent 48%),
    linear-gradient(155deg, #071610, #091b15 55%, #06120e);
}

.stage::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

#rackFarmScene {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
  color-scheme: dark;
}

#scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  touch-action: none;
}

.stage[data-scene-view="top"] #rackFarmScene {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.stage[data-scene-view="top"] #scene {
  opacity: 1;
  pointer-events: auto;
}

#scene:active {
  cursor: grabbing;
}

.plan-overlay {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  transition: opacity 140ms ease;
}

.stage[data-scene-view="top"] .plan-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.stage[data-plan-tool="section"] .plan-overlay,
.stage[data-plan-tool="row"] .plan-overlay {
  cursor: default;
}

.stage[data-plan-tool="door"] .plan-overlay,
.stage[data-plan-tool="column"] .plan-overlay {
  cursor: crosshair;
}

.plan-overlay .plan-selectable {
  fill: transparent;
  stroke: rgba(73, 222, 135, 0.34);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}

.plan-overlay .plan-selectable:active {
  cursor: grabbing;
}

.plan-overlay .is-selected,
.plan-overlay .plan-selected {
  fill: rgba(73, 222, 135, 0.16);
  stroke: var(--green);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.plan-overlay .plan-selection-box {
  fill: rgba(73, 222, 135, 0.08);
  stroke: var(--green);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

.plan-overlay .plan-drag-preview {
  opacity: 0.72;
  stroke: var(--lime);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

.plan-overlay .plan-snap-guide {
  fill: none;
  stroke: rgba(76, 185, 221, 0.9);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.plan-overlay .plan-door {
  fill: rgba(76, 185, 221, 0.16);
  stroke: var(--blue);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}

.plan-overlay .plan-solution-hit {
  fill: rgba(76, 185, 221, 0.025);
  stroke: transparent;
  stroke-width: 18;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: grab;
}

.plan-overlay .plan-column {
  fill: rgba(246, 197, 87, 0.2);
  stroke: var(--amber);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}

.plan-overlay .is-invalid,
.plan-overlay .plan-invalid {
  fill: rgba(251, 123, 107, 0.18);
  stroke: var(--danger);
}

.plan-editor {
  position: absolute;
  z-index: 6;
  top: 64px;
  left: 18px;
  display: none;
  width: min(448px, calc(100% - 36px));
  padding: 11px;
  border: 1px solid rgba(210, 239, 224, 0.16);
  border-radius: 14px;
  background: rgba(6, 20, 14, 0.9);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
}

.stage[data-scene-view="top"] .plan-editor {
  display: grid;
  gap: 9px;
}

.plan-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-editor-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.plan-editor-heading strong {
  color: #edf7f1;
  font-size: 11px;
  font-weight: 800;
}

.plan-editor-heading span:not(.plan-editor-badge) {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-editor-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(73, 222, 135, 0.2);
  border-radius: 6px;
  background: rgba(73, 222, 135, 0.1);
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plan-tool-groups {
  display: grid;
  gap: 6px;
}

.plan-tool-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.plan-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #a9bdb2;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  transition: 140ms ease;
}

.plan-tool svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-tool:hover:not(:disabled) {
  border-color: rgba(73, 222, 135, 0.3);
  background: rgba(73, 222, 135, 0.07);
  color: var(--text);
}

.plan-tool.active,
.plan-tool[aria-pressed="true"] {
  border-color: rgba(73, 222, 135, 0.5);
  background: rgba(73, 222, 135, 0.14);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(73, 222, 135, 0.06);
}

.plan-tool.danger:hover:not(:disabled) {
  border-color: rgba(251, 123, 107, 0.38);
  background: rgba(251, 123, 107, 0.1);
  color: #ff9a8d;
}

.plan-tool:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.plan-edit-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.plan-obstacle-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.plan-obstacle-settings > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.plan-number {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.plan-number:focus-within {
  border-color: rgba(73, 222, 135, 0.5);
  box-shadow: 0 0 0 2px rgba(73, 222, 135, 0.07);
}

.plan-number input {
  min-width: 0;
  width: 100%;
  height: 29px;
  padding: 0 2px 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  font-weight: 750;
}

.plan-number em {
  padding: 0 7px 0 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-style: normal;
}

.plan-editor-instructions {
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.4;
}

.plan-editor-status {
  min-height: 23px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(73, 222, 135, 0.065);
  color: #aee6c5;
  font-size: 9px;
  line-height: 1.35;
}

.plan-editor-status.warning {
  background: rgba(246, 197, 87, 0.08);
  color: var(--amber);
}

.plan-editor-status.error {
  background: rgba(251, 123, 107, 0.09);
  color: #ff9a8d;
}

.stage-toolbar {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.view-switch {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 20, 14, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.view-switch button,
.fit-button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  transition: 140ms ease;
}

.view-switch button {
  min-width: 54px;
  padding: 0 12px;
}

.view-switch button.active {
  background: #1d3a2d;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.045);
}

.fit-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(6, 20, 14, 0.78);
  backdrop-filter: blur(12px);
}

.fit-button:hover,
.view-switch button:hover {
  color: var(--text);
}

.fit-button svg {
  width: 14px;
  height: 14px;
}

.stage-status {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(50% - 110px);
  pointer-events: none;
}

.stage-status span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 20, 14, 0.72);
  color: #a4b9ae;
  font-size: 9px;
  font-weight: 650;
  backdrop-filter: blur(10px);
}

.stage[data-scene-view="top"] .stage-status {
  display: none;
}

.legend {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 20, 14, 0.72);
  color: var(--muted);
  font-size: 9px;
  backdrop-filter: blur(10px);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-rack { background: var(--green); }
.legend-aisle { background: #5f8873; }
.legend-node { background: var(--blue); }

.canvas-hint {
  position: absolute;
  z-index: 4;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(4, 14, 10, 0.48);
  color: var(--muted-2);
  font-size: 9px;
  pointer-events: none;
}

.canvas-hint svg {
  width: 14px;
  height: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.summary-panel > .metric-grid {
  margin: 12px 0 0;
}

.metric {
  display: grid;
  min-height: 88px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.metric.primary {
  border-color: rgba(73, 222, 135, 0.2);
  background: linear-gradient(145deg, rgba(73, 222, 135, 0.11), rgba(73, 222, 135, 0.025));
}

.metric > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.metric strong {
  align-self: end;
  color: #f2f8f4;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.035em;
}

.metric small {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9px;
}

.resource-costs {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.resource-costs-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.resource-costs-heading h3,
.resource-costs-heading p {
  margin: 0;
}

.resource-costs-heading h3 {
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.resource-costs-heading p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.4;
}

.resource-costs-heading > span {
  flex: none;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(10, 163, 96, 0.09);
  color: var(--green);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.resource-cost-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
}

.resource-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.resource-card-title > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.resource-card-title b {
  color: var(--text);
  font-size: 9px;
}

.resource-card-title small,
.resource-formula {
  color: var(--muted-2);
  font-size: 7px;
  line-height: 1.4;
}

.resource-card-title em {
  flex: none;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(10, 163, 96, 0.09);
  color: var(--green);
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.resource-card-title em.added {
  background: rgba(59, 143, 214, 0.09);
  color: var(--blue);
}

.resource-cost-card > strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.resource-cost-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.resource-cost-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.resource-cost-row span {
  color: var(--muted);
  font-size: 8px;
}

.resource-cost-row b {
  color: var(--text);
  font-size: 9px;
  text-align: right;
  white-space: nowrap;
}

.resource-cost-row.emphasis b {
  color: var(--green);
  font-size: 11px;
}

.resource-cost-card > a {
  width: fit-content;
  color: var(--green);
  font-size: 7px;
  font-weight: 650;
  text-underline-offset: 2px;
}

.estimate-card {
  padding: 16px;
  border: 1px solid rgba(73, 222, 135, 0.22);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(73, 222, 135, 0.12), transparent 38%),
    linear-gradient(155deg, #102a20, #0c2119);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.estimate-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #bdd0c6;
  font-size: 10px;
  font-weight: 650;
}

.estimate-badge {
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(73, 222, 135, 0.1);
  color: var(--green);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.estimate-total {
  margin-top: 9px;
  font-size: clamp(27px, 2.2vw, 34px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.055em;
}

.estimate-note {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.4;
}

.estimate-vat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(73, 222, 135, 0.16);
  border-radius: 9px;
  background: rgba(73, 222, 135, 0.06);
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.25;
}

.estimate-vat strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.estimate-breakdown {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.estimate-breakdown-card {
  margin: 14px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.estimate-breakdown-card .estimate-breakdown-heading {
  padding-top: 0;
}

.estimate-breakdown-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.estimate-breakdown-heading > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.estimate-breakdown-heading b {
  color: #d9e6df;
  font-size: 11px;
}

.estimate-breakdown-heading small {
  color: var(--muted-2);
  font-size: 9px;
}

.estimate-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--green);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.estimate-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(73, 222, 135, 0.1);
}

.estimate-breakdown summary {
  padding: 12px 0 0;
}

.estimate-lines {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.estimate-group-heading {
  margin-top: 2px;
  padding: 3px 0 1px;
  color: var(--green-deep);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estimate-group-heading:not(:first-child) {
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.project-specs {
  margin: 0 0 10px;
}

.spec-list {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.spec-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.spec-list span {
  color: var(--muted);
  font-size: 9px;
}

.spec-list strong {
  color: #dce9e2;
  font-size: 10px;
  text-align: right;
}

.estimate-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.estimate-line > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #c8d8cf;
  font-size: 11px;
}

.estimate-line small {
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.25;
}

.estimate-line strong {
  color: #f3f8f5;
  font-size: 11px;
  white-space: nowrap;
}

.estimate-line .estimated {
  color: var(--amber);
}

.price-editor {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.price-editor summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  list-style: none;
  cursor: pointer;
}

.price-editor summary::-webkit-details-marker {
  display: none;
}

.price-editor summary > span {
  display: grid;
  gap: 2px;
}

.price-editor summary b {
  color: #c9d8d0;
  font-size: 10px;
}

.price-editor summary small {
  color: var(--muted-2);
  font-size: 8px;
}

.price-editor summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  transition: transform 160ms ease;
}

.price-editor[open] summary svg {
  transform: rotate(180deg);
}

.price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 10px;
}

.price-editor-body {
  display: grid;
  gap: 10px;
  padding-top: 1px;
}

.price-editor-group + .price-editor-group {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.price-editor-group h3 {
  margin: 0;
  padding: 0 12px 8px;
  color: var(--text);
  font-size: 9px;
}

.price-fields input {
  min-height: 36px;
  padding: 0 9px;
}

.price-editor > p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.4;
}

.summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.summary-panel > .summary-actions {
  margin: 10px 0 0;
}

.summary-actions .pdf-button {
  grid-column: 1 / -1;
}

.share-project-block {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.share-project-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: stretch;
}

.share-project-cta {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 64px;
  gap: 11px;
  padding: 9px 12px 9px 10px;
  border: 1px solid var(--green);
  border-radius: 15px;
  background: linear-gradient(135deg, #0aa360, #078b51);
  color: #fff;
  box-shadow: 0 12px 26px rgba(10, 163, 96, 0.22);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.share-project-cta:hover,
.share-project-cta:focus-visible {
  background: linear-gradient(135deg, #099f5d, #067944);
  box-shadow: 0 15px 30px rgba(10, 163, 96, 0.28);
  transform: translateY(-1px);
}

.share-project-cta:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.share-project-cta__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
}

.share-project-cta__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-project-cta__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.share-project-cta__copy strong {
  font-size: 11px;
  line-height: 1.2;
}

.share-project-cta__copy small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.2;
}

.share-project-cta__arrow {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
}

.copy-project-link {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 64px;
  padding: 0;
  border: 1px solid rgba(10, 163, 96, 0.34);
  border-radius: 15px;
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 10px 22px rgba(18, 64, 44, 0.1);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.copy-project-link:hover,
.copy-project-link:focus-visible {
  border-color: var(--green);
  background: rgba(10, 163, 96, 0.07);
  box-shadow: 0 13px 26px rgba(18, 64, 44, 0.15);
  transform: translateY(-1px);
}

.copy-project-link:disabled {
  cursor: wait;
  opacity: 0.52;
  transform: none;
}

.copy-project-link svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-link-status {
  margin: 8px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(10, 163, 96, 0.22);
  border-radius: 10px;
  background: rgba(10, 163, 96, 0.06);
  color: var(--green-dark);
  font-size: 8px;
  line-height: 1.45;
}

.project-link-status[data-kind="error"] {
  border-color: rgba(206, 63, 63, 0.28);
  background: rgba(206, 63, 63, 0.06);
  color: #9e2f2f;
}

.mobile-result-bar {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 750;
  transition: 150ms ease;
}

.button:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #062013;
  box-shadow: 0 12px 26px rgba(41, 185, 104, 0.18);
}

.primary-button:hover {
  background: #62e796;
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: #b9cdc2;
}

.secondary-button:hover {
  border-color: rgba(73, 222, 135, 0.35);
  color: var(--text);
}

.commercial-note {
  display: grid;
  grid-template-columns: 17px 1fr;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted-2);
}

.commercial-note svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.commercial-note p {
  margin: 0;
  font-size: 8px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  padding: 10px 14px;
  border: 1px solid rgba(73, 222, 135, 0.28);
  border-radius: 10px;
  background: rgba(9, 33, 23, 0.94);
  color: #dcf7e8;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 28px 80px rgba(20, 31, 25, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(24, 34, 29, 0.48);
  backdrop-filter: blur(3px);
}

.confirm-dialog-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
}

.confirm-dialog-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(214, 69, 69, 0.09);
  color: var(--danger);
}

.confirm-dialog-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-dialog-copy h2 {
  margin: 1px 0 8px;
  font-size: 19px;
  line-height: 1.2;
}

.confirm-dialog-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.confirm-dialog-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 4px;
}

.confirm-dialog-actions .button {
  min-height: 44px;
}

.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: #fff;
}

.danger-button:hover {
  border-color: #bd3636;
  background: #bd3636;
}

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: 290px minmax(0, 1fr) 310px;
  }

  .panel {
    padding: 18px;
  }

  .brand {
    padding-left: 18px;
  }
}

@media (min-width: 761px) and (max-width: 1600px) {
  .stage-status {
    top: 68px;
    max-width: calc(100% - 36px);
  }

  .stage[data-scene-view="top"] .stage-status {
    display: none;
  }
}

@media (max-width: 1050px) {
  .app-shell {
    display: block;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    position: sticky;
    top: 0;
    min-height: 62px;
  }

  .brand {
    border-right: 0;
  }

  .topbar-title {
    display: none;
  }

  .room-preset-row > span {
    display: none;
  }

  .room-presets {
    width: 100%;
  }

  .room-presets button {
    min-width: 0;
  }

  .workspace {
    grid-template-columns: minmax(250px, 30%) minmax(0, 1fr) minmax(270px, 30%);
    grid-template-rows: minmax(560px, calc(100vh - 62px));
    height: calc(100vh - 62px);
  }

  .config-panel {
    grid-column: 1;
    grid-row: 1;
    max-height: calc(100vh - 62px);
  }

  .stage {
    grid-column: 2;
    grid-row: 1;
  }

  .summary-panel {
    grid-column: 3;
    grid-row: 1;
    display: block;
    max-height: calc(100vh - 62px);
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .summary-panel .panel-heading {
    margin-bottom: 18px;
  }

  .estimate-card {
    margin: 0;
  }

  .metric-grid {
    margin-top: 16px;
  }

  .project-specs {
    margin-top: 14px;
  }

  .summary-actions {
    margin-top: 14px;
  }

  .resource-costs {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .price-editor {
    margin-top: 14px;
  }

  .commercial-note {
    margin-top: 14px;
  }
}

@media (min-width: 901px) and (max-width: 1260px) {
  .summary-panel > .client-metrics {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .client-metrics .metric {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    min-height: 60px;
    padding: 9px 10px;
  }

  .client-metrics .metric > span {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
  }

  .client-metrics .metric strong {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    margin-left: 10px;
    font-size: 18px;
    white-space: nowrap;
  }

  .client-metrics .metric small {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .topbar {
    min-height: 58px;
  }

  .brand {
    padding: 0 14px;
  }

  .brand-logo {
    height: 40px;
  }

  .icon-button span {
    display: none;
  }

  .icon-button {
    margin-right: 10px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .config-panel,
  .summary-panel {
    max-height: none;
    overflow: visible;
    border: 0;
  }

  .config-panel {
    order: 1;
  }

  .summary-panel {
    order: 2;
  }

  .stage {
    order: 3;
    min-height: 58vh;
    max-height: 720px;
    border-bottom: 1px solid var(--line);
  }

  .config-panel {
    border-bottom: 1px solid var(--line);
  }

  .summary-panel {
    display: block;
  }

  .summary-panel > * + * {
    margin-top: 12px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
  }

  .resource-costs {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .resource-costs-heading {
    grid-column: auto;
  }

  body {
    padding-bottom: 68px;
  }

  .mobile-result-bar {
    position: fixed;
    z-index: 45;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    padding: 8px 9px 8px 14px;
    border: 1px solid rgba(73, 222, 135, 0.3);
    border-radius: 14px;
    background: rgba(8, 30, 20, 0.94);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  body.result-in-view .mobile-result-bar,
  body.plan-view-active .mobile-result-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(130%);
  }

  .mobile-result-bar > span {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .mobile-result-bar small {
    color: var(--muted);
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .mobile-result-bar strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-result-bar strong b {
    color: var(--green);
  }

  .mobile-result-bar button {
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: var(--green);
    color: #052013;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
  }

  .stage-status {
    top: 64px;
    left: 12px;
    max-width: calc(100% - 24px);
  }

  .stage-toolbar {
    top: 14px;
    left: auto;
    right: 12px;
    transform: none;
  }

  .plan-editor {
    top: 58px;
    left: 12px;
    width: calc(100% - 24px);
    max-height: calc(100% - 72px);
    overflow-y: auto;
    scrollbar-color: rgba(138, 183, 159, 0.24) transparent;
    scrollbar-width: thin;
  }

  .fit-button span,
  .fit-button {
    font-size: 0;
  }

  .fit-button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .fit-button svg {
    width: 15px;
    height: 15px;
  }

  .legend {
    right: 12px;
    bottom: 12px;
    max-width: 55%;
  }

  .canvas-hint {
    left: 12px;
    bottom: 12px;
  }

  .canvas-hint span {
    display: none;
  }
}

/* v38: explicit storage choice inside the solution-node card. */
.solution-controls {
  gap: 9px;
  max-height: 430px;
}

.solution-storage-field {
  display: grid;
  gap: 6px;
  margin: 5px 0 2px;
}

.solution-storage-field > span {
  font-size: 11px;
  font-weight: 700;
}

.solution-storage-field > small {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .solution-storage-field select {
    min-height: 44px;
  }
}

/* v40: clearer three-step flow and safe export states. */
.open-plan-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin-top: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(10, 163, 96, 0.24);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.open-plan-editor:hover,
.open-plan-editor:focus-visible {
  border-color: rgba(10, 163, 96, 0.55);
  background: rgba(10, 163, 96, 0.055);
}

.open-plan-editor:hover {
  transform: translateY(-1px);
}

.open-plan-editor > span:first-child {
  display: grid;
  gap: 2px;
}

.open-plan-editor b {
  font-size: 10px;
}

.open-plan-editor small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.35;
}

.open-plan-editor > span:last-child {
  color: var(--green);
  font-size: 18px;
}

.stage-status .stage-step-badge {
  border-color: rgba(10, 163, 96, 0.24);
  background: rgba(234, 249, 241, 0.96);
  color: #087d4b;
}

.stage-step-badge b {
  margin-right: 4px;
  font-size: inherit;
}

.estimate-validity-note {
  margin: 9px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(205, 67, 67, 0.2);
  border-radius: 9px;
  background: rgba(205, 67, 67, 0.065);
  color: #a23737;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.45;
}

.estimate-validity-note[hidden] {
  display: none;
}

.summary-panel.project-invalid .estimate-card {
  border-color: rgba(205, 67, 67, 0.28);
  background: linear-gradient(155deg, #fff, #fff7f7);
}

.summary-panel.project-invalid .estimate-total {
  color: #a23737;
}

.estimate-breakdown.is-unavailable {
  opacity: 0.58;
}

.summary-actions .button:disabled,
.saved-calculation-save:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.summary-actions .button[aria-busy="true"] {
  cursor: progress;
}

@media (max-width: 420px) {
  .stage-status span:nth-child(2) {
    display: inline-flex;
  }

  .stage-status #roomBadge {
    display: none;
  }

  .stage-step-badge {
    white-space: nowrap;
  }
}

@media print {
  .open-plan-editor {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .panel {
    padding: 16px 14px;
  }

  .stage {
    min-height: 54vh;
  }

  .client-metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    min-height: 68px;
    align-items: center;
  }

  .metric > span {
    align-self: end;
  }

  .metric strong {
    grid-row: 1 / 3;
    grid-column: 2;
    font-size: 24px;
  }

  .view-switch button {
    min-width: 45px;
    padding: 0 8px;
  }

  .plan-editor {
    padding: 9px;
    border-radius: 12px;
  }

  .plan-tool {
    gap: 3px;
    padding: 0 4px;
    font-size: 8px;
  }

  .plan-tool svg {
    width: 13px;
    height: 13px;
  }

  .plan-obstacle-settings > label {
    grid-template-columns: minmax(0, 1fr) 65px;
    font-size: 8px;
  }

  .stage-status #roomBadge {
    display: none;
  }

  .legend {
    gap: 7px;
    max-width: 66%;
  }

  .legend span:nth-child(2) {
    display: none;
  }
}

/* UFARMS public-site light theme: #0aa360, #fff/#f8f8f8, #ececec, #333/#555/#999. */
.icon-button:hover {
  background: #f8f8f8;
}

.section-label span,
.section-kicker,
.advanced-settings summary b,
.project-specs summary b,
.estimate-breakdown summary b,
.price-editor summary b,
.spec-list strong,
.estimate-line > span:first-child,
.estimate-line strong,
.metric strong {
  color: var(--text);
}

.number-wrap,
.tier-button,
.advanced-settings,
.project-specs,
.price-editor,
.metric,
.plan-number {
  background: #ffffff;
}

.number-wrap:focus-within,
.plan-number:focus-within {
  border-color: rgba(10, 163, 96, 0.5);
  box-shadow: 0 0 0 3px rgba(10, 163, 96, 0.1);
}

.tier-button:hover {
  background: #fafafa;
}

.tier-button.active {
  border-color: rgba(10, 163, 96, 0.5);
  background: linear-gradient(145deg, rgba(10, 163, 96, 0.13), rgba(10, 163, 96, 0.04));
  box-shadow: inset 0 0 0 1px rgba(10, 163, 96, 0.04);
}

select,
.price-fields input {
  background: #ffffff;
  color: var(--text);
}

input[type="range"] {
  background: linear-gradient(90deg, var(--green) 0 var(--range-progress, 50%), #e9e9e9 var(--range-progress, 50%) 100%);
}

input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
  border-color: #ffffff;
}

.switch span {
  background: #d5d5d5;
}

.switch span::after {
  background: #ffffff;
}

.node-chip-row span {
  border-color: rgba(10, 163, 96, 0.18);
  background: rgba(10, 163, 96, 0.08);
  color: var(--green);
}

.layout-notice {
  border-color: rgba(10, 163, 96, 0.2);
  background: rgba(10, 163, 96, 0.07);
}

.notice-icon {
  background: rgba(10, 163, 96, 0.12);
}

.stage {
  background:
    radial-gradient(circle at 50% 38%, rgba(10, 163, 96, 0.07), transparent 48%),
    linear-gradient(155deg, #ffffff, #f2f2f2 68%, #ececec);
}

.stage::before {
  background-image:
    linear-gradient(rgba(10, 163, 96, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 163, 96, 0.035) 1px, transparent 1px);
}

#rackFarmScene {
  color-scheme: light;
}

.plan-editor,
.view-switch,
.fit-button,
.stage-status span,
.legend,
.canvas-hint {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.plan-editor-heading strong {
  color: var(--text);
}

.plan-editor-badge,
.plan-tool.active,
.plan-tool[aria-pressed="true"] {
  border-color: rgba(10, 163, 96, 0.35);
  background: rgba(10, 163, 96, 0.1);
  color: var(--green);
}

.plan-tool {
  background: #ffffff;
  color: var(--muted);
}

.plan-tool:hover:not(:disabled) {
  border-color: rgba(10, 163, 96, 0.35);
  background: rgba(10, 163, 96, 0.06);
  color: var(--text);
}

.plan-editor-status {
  background: rgba(10, 163, 96, 0.08);
  color: #087d4b;
}

.view-switch button.active {
  background: var(--green);
  color: #ffffff;
  box-shadow: none;
}

.stage-status span {
  color: var(--muted);
}

.canvas-hint {
  color: var(--muted-2);
}

.metric.primary {
  border-color: rgba(10, 163, 96, 0.22);
  background: linear-gradient(145deg, rgba(10, 163, 96, 0.11), #ffffff);
}

.estimate-card {
  border-color: rgba(10, 163, 96, 0.28);
  background:
    radial-gradient(circle at 100% 0, rgba(10, 163, 96, 0.13), transparent 40%),
    linear-gradient(155deg, #ffffff, #f5fbf7);
  box-shadow: 0 14px 36px rgba(31, 49, 40, 0.1);
}

.estimate-title {
  color: var(--muted);
}

.estimate-breakdown-heading b {
  color: var(--text);
}

.estimate-badge {
  background: rgba(10, 163, 96, 0.1);
}

.estimate-vat {
  border-color: rgba(10, 163, 96, 0.18);
  background: rgba(10, 163, 96, 0.06);
}

.estimate-total {
  color: var(--text);
}

.primary-button {
  border-color: var(--green);
  border-radius: 26px;
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(10, 163, 96, 0.2);
}

.primary-button:hover {
  background: #099f5d;
}

.secondary-button {
  border-color: #d5d5d5;
  border-radius: 26px;
  background: #ffffff;
  color: var(--muted);
}

.secondary-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.toast {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.mobile-result-bar {
  border-color: rgba(10, 163, 96, 0.3);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(31, 49, 40, 0.16);
}

.mobile-result-bar strong {
  color: var(--text);
}

.mobile-result-bar button {
  border-radius: 24px;
  color: #ffffff;
}

.estimate-product-link {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 8px;
  color: var(--text);
  font-size: 10px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.estimate-product-name {
  min-width: 0;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-color: rgba(10, 163, 96, 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.estimate-product-name i {
  display: inline-block;
  color: var(--green);
  font-size: 9px;
  font-style: normal;
  text-decoration: none;
  transition: transform 160ms ease;
}

.estimate-product-link:hover,
.estimate-product-link:focus-visible {
  outline: none;
  background: rgba(10, 163, 96, 0.07);
  color: var(--green-dark);
}

.estimate-product-link:hover .estimate-product-name,
.estimate-product-link:focus-visible .estimate-product-name {
  text-decoration-color: currentColor;
}

.estimate-product-link:hover .estimate-product-name i,
.estimate-product-link:focus-visible .estimate-product-name i {
  transform: translate(1px, -1px);
}

.product-hint {
  position: fixed;
  z-index: 90;
  left: 12px;
  top: 12px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 24px));
  min-height: 116px;
  padding: 11px;
  overflow: hidden;
  pointer-events: none;
  border: 1px solid rgba(10, 163, 96, 0.22);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.985);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(31, 49, 40, 0.2);
  opacity: 0;
  transform: translateY(5px) scale(0.985);
  transform-origin: top left;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}

.product-hint.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition-delay: 0s;
}

.product-hint-media {
  display: grid;
  place-items: center;
  min-height: 92px;
  overflow: hidden;
  border: 1px solid #ececec;
  border-radius: 11px;
  background: #f8f8f8;
}

.product-hint-media img {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: contain;
}

.product-hint-copy {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.product-hint-kicker {
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.product-hint-copy > strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.product-hint-detail {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.product-hint-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  margin-top: auto;
  border-top: 1px solid #ececec;
}

.product-hint-footer b {
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}

.product-hint-footer small {
  color: var(--green-dark);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

.plan-selectable[data-product-key]:focus-visible {
  outline: none;
  stroke: var(--green);
  stroke-width: 3px;
}

/* In plan mode the editor is a dock below the drawing, never an overlay on it. */
.stage[data-scene-view="top"] {
  --plan-editor-dock-height: 230px;
}

.stage[data-scene-view="top"] #scene,
.stage[data-scene-view="top"] .plan-overlay {
  bottom: auto;
  height: calc(100% - var(--plan-editor-dock-height));
}

.stage[data-scene-view="top"] .plan-editor {
  grid-template-areas:
    "heading heading"
    "tools settings"
    "tools instructions"
    "tools status";
  grid-template-columns: minmax(320px, 1.2fr) minmax(260px, 0.8fr);
  grid-template-rows: auto auto auto 1fr;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  width: 100%;
  height: var(--plan-editor-dock-height);
  max-height: none;
  padding: 12px 16px;
  overflow-y: auto;
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: 0 -12px 30px rgba(31, 49, 40, 0.1);
  backdrop-filter: none;
}

.stage[data-scene-view="top"] .plan-editor-heading {
  grid-area: heading;
}

.stage[data-scene-view="top"] .plan-tool-groups {
  grid-area: tools;
  align-self: start;
}

.stage[data-scene-view="top"] .plan-obstacle-settings {
  grid-area: settings;
}

.stage[data-scene-view="top"] .plan-editor-instructions {
  grid-area: instructions;
}

.stage[data-scene-view="top"] .plan-editor-status {
  grid-area: status;
}

.stage[data-scene-view="top"] .legend,
.stage[data-scene-view="top"] .canvas-hint {
  display: none;
}

@media (max-width: 1050px) {
  .stage[data-scene-view="top"] {
    --plan-editor-dock-height: 320px;
    min-height: 820px;
    max-height: none;
  }

  .stage[data-scene-view="top"] .plan-editor {
    grid-template-areas:
      "heading"
      "tools"
      "settings"
      "instructions"
      "status";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    padding: 10px 12px;
  }
}

/* Mobile layout: parameters → model → estimate, with persistent jump controls. */
.resource-costs-heading {
  list-style: none;
  cursor: pointer;
}

.resource-costs-heading::-webkit-details-marker {
  display: none;
}

.resource-costs-meta {
  margin-left: auto;
}

.resource-costs-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.resource-costs[open] .resource-costs-chevron {
  transform: rotate(180deg);
}

.mobile-result-actions {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 6px !important;
  overflow: visible !important;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .topbar {
    position: relative;
    top: auto;
    min-height: 52px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand {
    padding: 0 12px;
  }

  .brand-logo {
    height: 34px;
  }

  .topbar-title {
    justify-content: flex-start;
    overflow: hidden;
    font-size: 11px;
    white-space: nowrap;
  }

  .topbar-flow {
    display: none;
  }

  .icon-button {
    width: auto;
    min-width: 42px;
    height: 42px;
    justify-content: center;
    margin-right: 4px;
    gap: 6px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .icon-button span {
    display: inline;
    font-size: 10px;
    font-weight: 650;
  }

  .workspace {
    height: auto;
    min-height: calc(100svh - 52px);
  }

  .panel {
    padding: 16px;
  }

  .config-panel {
    order: 1;
  }

  .stage {
    order: 2;
    min-height: clamp(500px, 66svh, 620px);
    max-height: none;
  }

  .summary-panel {
    order: 3;
    padding-bottom: 22px;
  }

  .panel-heading {
    grid-template-columns: 30px 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .panel-heading.compact {
    margin-bottom: 12px;
  }

  .step {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .panel-heading h1,
  .panel-heading h2 {
    font-size: 17px;
  }

  .panel-heading p {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.35;
  }

  .control-section {
    padding: 13px 0;
  }

  .layout-control-section {
    gap: 8px;
  }

  .orientation-toggle {
    min-height: 54px;
    padding: 8px 10px;
  }

  .section-label {
    margin-bottom: 8px;
  }

  .number-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .field.full {
    grid-column: auto;
  }

  .number-wrap input {
    min-height: 44px;
    padding: 9px 2px 9px 9px;
  }

  .number-wrap em {
    padding-right: 8px;
  }

  .tier-picker {
    margin-bottom: 0;
  }

  .tier-slope-hint {
    margin-top: 8px;
  }

  .tier-button {
    min-height: 58px;
    padding: 8px 10px;
  }

  .tier-button strong {
    font-size: 25px;
  }

  .solution-section {
    padding-bottom: 11px;
  }

  .node-chip-row {
    gap: 5px;
  }

  .node-chip-row span {
    padding: 4px 6px;
    font-size: 8px;
  }

  .layout-notice {
    padding: 8px 10px;
  }

  .stage-toolbar {
    top: 10px;
    right: 10px;
    left: 10px;
    gap: 6px;
  }

  .view-switch {
    flex: 1 1 auto;
    min-width: 0;
  }

  .view-switch button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 0 6px;
  }

  .fit-button {
    flex: 0 0 40px;
    width: 40px;
    min-height: 40px;
  }

  .stage-status {
    top: 62px;
    left: 10px;
    max-width: calc(100% - 20px);
  }

  .metric-grid,
  .client-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 12px 0 0;
  }

  .metric {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-height: 84px;
    padding: 10px 8px;
  }

  .metric > span {
    align-self: auto;
    font-size: 8px;
  }

  .metric strong {
    grid-column: auto;
    grid-row: auto;
    align-self: end;
    font-size: clamp(16px, 5vw, 20px);
  }

  .metric small {
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .summary-actions {
    margin: 12px 0 0;
  }

  .resource-costs {
    display: grid;
    grid-template-columns: 1fr;
    margin: 12px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
  }

  .resource-costs-heading {
    grid-column: auto;
    align-items: center;
    min-height: 56px;
    padding: 10px 12px;
  }

  .resource-costs-heading p {
    max-width: 230px;
  }

  .resource-costs > .resource-cost-card {
    margin: 0 10px 10px;
  }

  .project-specs,
  .price-editor,
  .commercial-note {
    margin-top: 12px;
  }

  body {
    padding-bottom: 76px;
  }

  .mobile-result-bar {
    min-height: 56px;
    gap: 8px;
    padding: 7px 8px 7px 12px;
  }

  body.result-in-view .mobile-result-bar {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .mobile-result-bar button {
    min-width: 56px;
    min-height: 42px;
    padding: 8px 10px;
  }

  .mobile-result-bar .mobile-result-secondary {
    border: 1px solid rgba(73, 222, 135, 0.3);
    background: transparent;
    color: var(--green);
  }

  .stage[data-scene-view="top"] {
    --plan-editor-dock-height: 390px;
    min-height: 890px;
  }

  .stage[data-scene-view="top"] .plan-editor {
    padding: 10px;
  }

  .stage[data-scene-view="top"] .plan-tool {
    min-height: 42px;
    padding: 0 5px;
    font-size: 8px;
  }

  .stage[data-scene-view="top"] .plan-number input {
    height: 38px;
  }
}

@media (max-width: 420px) {
  .stage[data-scene-view="top"] {
    --plan-editor-dock-height: 430px;
    min-height: 930px;
  }

  .stage[data-scene-view="top"] .plan-tool-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage[data-scene-view="top"] .plan-edit-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stage[data-scene-view="top"] .plan-tool {
    min-height: 44px;
    padding: 0 8px;
    font-size: 9px;
  }

  .panel {
    padding: 14px 12px;
  }

  .number-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field.full {
    grid-column: 1 / -1;
  }

  .topbar-title span:not(.live-dot) {
    display: none;
  }

  .panel-heading p {
    max-width: 290px;
  }

  .tier-button {
    min-height: 72px;
    align-items: center;
    row-gap: 2px;
  }

  .tier-button strong {
    grid-row: 1;
  }

  .tier-button small {
    grid-column: 1 / -1;
    max-width: none;
    overflow: visible;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
  }

  .layout-notice small {
    display: -webkit-box;
    overflow: hidden;
    font-size: 8.5px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .layout-notice {
    grid-template-columns: 26px 1fr;
    min-height: 50px;
  }

  .field-heading {
    gap: 3px;
  }

  .field-heading small {
    font-size: 8.5px;
  }

  .room-preset-row > span {
    display: none;
  }

  .room-presets {
    width: 100%;
  }

  .room-presets button {
    min-width: 0;
    min-height: 44px;
  }

  .room-presets b {
    font-size: 10.5px;
  }

  .room-presets small {
    font-size: 8.5px;
  }

  .confirm-dialog-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }

  .confirm-dialog-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .confirm-dialog-copy h2 {
    font-size: 17px;
  }

  .confirm-dialog-actions {
    grid-template-columns: 1fr;
  }

  .confirm-dialog-actions .secondary-button {
    order: 2;
  }

  .estimate-card {
    padding: 14px;
  }

  .estimate-lines {
    gap: 7px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .resource-costs-meta {
    display: none;
  }

  .mobile-result-bar > span:first-child {
    max-width: calc(100% - 128px);
  }
}

.saved-calculations {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
}

.saved-calculations-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.saved-calculations-heading > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.saved-calculations-heading b {
  color: var(--text);
  font-size: 11px;
}

.saved-calculations-heading small,
.saved-calculation-note,
.saved-calculation-empty {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.35;
}

.saved-calculation-save {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(10, 163, 96, 0.28);
  border-radius: 18px;
  background: rgba(10, 163, 96, 0.07);
  color: var(--green-dark);
  font-size: 8px;
  font-weight: 750;
}

.saved-calculation-save:hover,
.saved-calculation-save:focus-visible {
  border-color: var(--green);
  background: rgba(10, 163, 96, 0.12);
  outline: none;
}

.project-link-contract {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
}

.project-link-contract > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.project-link-contract > summary::-webkit-details-marker {
  display: none;
}

.project-link-contract > summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-link-contract > summary b {
  color: var(--text);
  font-size: 10px;
}

.project-link-contract > summary small {
  color: var(--muted-2);
  font-size: 8px;
}

.project-link-contract > summary svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 150ms ease;
}

.project-link-contract[open] > summary svg {
  transform: rotate(180deg);
}

.project-link-contract-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.project-link-contract-body p {
  margin: 0;
}

.project-link-contract-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(10, 163, 96, 0.08);
  color: var(--green-dark);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.95em;
}

.project-schema-link {
  width: fit-content;
  color: var(--green-dark);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: rgba(10, 163, 96, 0.35);
  text-underline-offset: 2px;
}

.saved-calculation-current,
.saved-calculation-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(10, 163, 96, 0.2);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(10, 163, 96, 0.09), rgba(10, 163, 96, 0.025));
}

.saved-calculation-current > div,
.saved-calculation-open > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.saved-calculation-current strong,
.saved-calculation-open strong {
  overflow: hidden;
  color: var(--text);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-calculation-current small,
.saved-calculation-open small {
  overflow: visible;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.saved-calculation-status,
.saved-calculation-match {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 12px;
  background: var(--green);
  color: #ffffff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.saved-calculation-list {
  display: grid;
  gap: 7px;
}

.saved-calculation-item {
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  padding: 5px 5px 5px 9px;
  border-color: var(--line);
  background: #ffffff;
}

.saved-calculation-item.is-current {
  border-color: rgba(10, 163, 96, 0.34);
  background: rgba(10, 163, 96, 0.04);
}

.saved-calculation-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 3px 0;
  color: inherit;
  text-align: left;
}

.saved-calculation-open time {
  color: var(--muted-2);
  font-size: 7px;
  white-space: nowrap;
}

.saved-calculation-open:hover strong,
.saved-calculation-open:focus-visible strong {
  color: var(--green-dark);
}

.saved-calculation-open:focus-visible,
.saved-calculation-delete:focus-visible {
  border-radius: 7px;
  outline: 2px solid rgba(10, 163, 96, 0.35);
  outline-offset: 1px;
}

.saved-calculation-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted-2);
  font-size: 15px;
}

.saved-calculation-delete:hover {
  background: #fff1ef;
  color: #b84a3d;
}

.saved-calculation-empty,
.saved-calculation-note {
  margin: 0;
}

.saved-calculation-empty[hidden] {
  display: none;
}

@media (max-width: 420px) {
  .saved-calculations {
    padding: 10px;
  }

  .saved-calculations-heading {
    align-items: flex-start;
  }

  .saved-calculation-save {
    min-height: 38px;
    padding: 0 10px;
  }

  .saved-calculation-current {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}

.irrigation-summary {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid rgba(10, 163, 96, 0.2);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(10, 163, 96, 0.07), #ffffff 62%);
}

.irrigation-summary-heading,
.irrigation-summary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.irrigation-summary-heading > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.irrigation-summary-heading small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.irrigation-summary-heading strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.irrigation-summary-heading em {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(10, 163, 96, 0.1);
  color: #087d4b;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.irrigation-summary-heading em.warning {
  background: #fff4d7;
  color: #8a6200;
}

.irrigation-summary > p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.irrigation-summary > .drainage-segment-note {
  padding: 7px 8px;
  border: 1px solid rgba(31, 103, 137, 0.13);
  border-radius: 8px;
  background: rgba(61, 153, 191, 0.06);
  color: #315c70;
}

.irrigation-zone-details {
  min-width: 0;
  border: 1px solid rgba(10, 163, 96, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.irrigation-zone-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 8px;
  cursor: pointer;
  list-style: none;
}

.irrigation-zone-details > summary::-webkit-details-marker {
  display: none;
}

.irrigation-zone-details > summary > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.irrigation-zone-details > summary b {
  color: var(--text);
  font-size: 9px;
}

.irrigation-zone-details > summary small,
.irrigation-zone-details > summary em {
  color: var(--muted-2);
  font-size: 7px;
  font-style: normal;
}

.irrigation-zone-details > summary em {
  white-space: nowrap;
}

.irrigation-zone-details > summary svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted-2);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.irrigation-zone-details[open] > summary svg {
  transform: rotate(180deg);
}

.irrigation-zone-details > .irrigation-zone-lines {
  margin: 0 8px 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(10, 163, 96, 0.1);
}

.irrigation-zone-lines {
  display: grid;
  gap: 5px;
}

.irrigation-zone-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.irrigation-zone-line > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 650;
  white-space: nowrap;
}

.irrigation-zone-line > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.irrigation-zone-line i {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  min-height: 26px;
  overflow: hidden;
  padding: 6px 7px;
  border: 1px solid rgba(10, 163, 96, 0.16);
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--text);
  font-style: normal;
}

.irrigation-zone-line i::before {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: var(--zone-load);
  background: rgba(10, 163, 96, 0.12);
  content: "";
}

.irrigation-zone-line i.warning {
  border-color: rgba(201, 145, 0, 0.28);
  background: #fffaf0;
}

.irrigation-zone-line i.warning::before {
  background: rgba(232, 173, 19, 0.18);
}

.irrigation-zone-line b {
  font-size: 10px;
}

.irrigation-zone-line small {
  color: var(--muted-2);
  font-size: 7px;
}

.irrigation-summary-footer {
  align-items: baseline;
  padding-top: 7px;
  border-top: 1px solid rgba(10, 163, 96, 0.12);
  font-size: 8px;
}

.irrigation-summary-footer > span {
  color: var(--muted);
}

.irrigation-summary-footer a {
  color: var(--green);
  font-weight: 650;
  text-align: right;
  text-decoration-color: rgba(10, 163, 96, 0.28);
  text-underline-offset: 2px;
}

.irrigation-summary-footer a:hover,
.irrigation-summary-footer a:focus-visible {
  color: #087d4b;
  text-decoration-color: currentColor;
}

@media (max-width: 420px) {
  .irrigation-summary {
    padding: 10px;
  }

  .irrigation-summary-heading,
  .irrigation-summary-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .irrigation-summary-footer a {
    text-align: left;
  }

  .irrigation-zone-details > summary {
    grid-template-columns: minmax(0, 1fr) auto 14px;
  }
}

/* Mobile interaction: keep every primary tap target comfortably reachable. */
@media (max-width: 900px) {
  .view-switch button,
  .fit-button,
  .mobile-result-bar button,
  .saved-calculation-save,
  .irrigation-zone-details > summary,
  .price-fields input,
  .resource-cost-card > a,
  .estimate-product-link,
  .irrigation-summary-footer a {
    min-height: 44px;
  }

  .fit-button {
    flex-basis: 44px;
    width: 44px;
  }

  .stage-status {
    top: 66px;
  }

  .saved-calculation-save {
    padding-right: 12px;
    padding-left: 12px;
  }

  .estimate-product-link {
    align-content: center;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .resource-cost-card > a,
  .irrigation-summary-footer a {
    display: inline-flex;
    align-items: center;
    width: fit-content;
  }

  .resource-cost-card > a {
    font-size: 9px;
  }

  .switch {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
  }

  input[type="range"] {
    height: 44px;
    margin: -8px 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 4px;
  }

  body.mobile-jump-to-parameters .mobile-result-secondary {
    min-width: 82px;
  }
}

@media (max-width: 420px) {
  body.mobile-jump-to-parameters .mobile-result-bar > span:first-child {
    max-width: calc(100% - 150px);
  }
}

@media (max-width: 360px) {
  body.mobile-jump-to-parameters .mobile-result-secondary {
    min-width: 66px;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 9px;
  }

  body.mobile-jump-to-parameters .mobile-result-bar > span:first-child {
    max-width: calc(100% - 132px);
  }

  .mobile-result-bar strong {
    font-size: 12px;
  }
}

@media print {
  .topbar,
  .config-panel,
  .stage-toolbar,
  .stage-status,
  .canvas-hint,
  .legend,
  .advanced-settings,
  .price-editor,
  .summary-actions,
  .mobile-result-bar,
  .plan-editor,
  .plan-overlay,
  .product-hint,
  .confirm-dialog,
  .toast,
  .saved-calculations,
  .project-link-status,
  .project-link-contract {
    display: none !important;
  }

  details.estimate-breakdown:not([open]) > :not(summary),
  details.irrigation-zone-details:not([open]) > :not(summary) {
    display: grid !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

html[data-embed-mode="project-preview"],
html[data-embed-mode="project-preview"] body,
html[data-embed-mode="project-preview"] .app-shell,
html[data-embed-mode="project-preview"] .workspace {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

html[data-embed-mode="project-preview"] .app-shell,
html[data-embed-mode="project-preview"] .workspace {
  display: block;
}

html[data-embed-mode="project-preview"] body {
  margin: 0;
  padding: 0 !important;
}

html[data-embed-mode="project-preview"] .topbar,
html[data-embed-mode="project-preview"] .config-panel,
html[data-embed-mode="project-preview"] .summary-panel,
html[data-embed-mode="project-preview"] .stage-toolbar,
html[data-embed-mode="project-preview"] .stage-status,
html[data-embed-mode="project-preview"] .canvas-hint,
html[data-embed-mode="project-preview"] .legend,
html[data-embed-mode="project-preview"] .mobile-result-bar,
html[data-embed-mode="project-preview"] .plan-editor,
html[data-embed-mode="project-preview"] .plan-overlay {
  display: none !important;
}

html[data-embed-mode="project-preview"] .stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 0;
}

html[data-embed-mode="project-preview"] #rackFarmScene {
  pointer-events: auto;
}

/* v40 a11y fixes: no invisible footer over the result and 44 px variant actions. */
.saved-calculation-open {
  min-height: 44px;
}

.saved-calculation-delete {
  width: 44px;
  height: 44px;
}

.saved-calculation-item {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.saved-calculation-open strong {
  font-size: 10px;
}

.saved-calculation-open time,
.saved-calculation-status,
.saved-calculation-match {
  font-size: 8px;
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .mobile-result-bar {
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  body.result-in-view .mobile-result-bar,
  body.plan-view-active .mobile-result-bar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(130%);
  }
}
