:root {
  --bg: #e9edf2;
  --bg-deep: #d8dee6;
  --surface: #f4f6f9;
  --surface-raised: #fbfcfd;
  --ink: #1c242e;
  --muted: #5e6b7a;
  --line: #c5ced8;
  --line-soft: #d9e0e8;
  --teal: #2f9e90;
  --teal-dark: #217a70;
  --blue: #2a4558;
  --blue-soft: #dce6ed;
  --accent: #e09a3a;
  --accent-soft: rgba(224, 154, 58, 0.18);
  --danger: #c23b3b;
  --glow: 0 0 24px rgba(47, 158, 144, 0.22);
  --glow-accent: 0 0 20px rgba(224, 154, 58, 0.2);
  --shadow-block: 8px 8px 0 rgba(42, 69, 88, 0.12), 0 18px 40px rgba(28, 36, 46, 0.1);
  --radius: 14px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse at 10% -10%, rgba(47, 158, 144, 0.1), transparent 42%),
    radial-gradient(ellipse at 90% 0%, rgba(224, 154, 58, 0.08), transparent 38%),
    linear-gradient(165deg, #f0f3f7 0%, var(--bg) 48%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.block-3d {
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-block);
  border-radius: var(--radius);
  position: relative;
}

.block-3d::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(240, 243, 247, 0.82);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #4a6478, var(--blue));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 7px;
  box-shadow: 3px 3px 0 rgba(224, 154, 58, 0.45), var(--glow);
}

.brand-mark span {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 2px;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
}

.btn:active {
  transform: translate(1px, 1px);
}

.btn-primary {
  background: linear-gradient(145deg, #35586c, var(--blue));
  color: #fff;
  box-shadow: 4px 4px 0 rgba(28, 36, 46, 0.25), var(--glow);
}

.btn-primary:hover {
  background: #1f3544;
}

.btn-teal {
  background: linear-gradient(145deg, #3cb3a4, var(--teal));
  color: #fff;
  box-shadow: 4px 4px 0 rgba(33, 122, 112, 0.3);
}

.btn-teal:hover {
  background: var(--teal-dark);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(42, 69, 88, 0.08);
}

.btn-soft {
  background: var(--blue-soft);
  color: var(--blue);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero .brand-hero {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  background: linear-gradient(120deg, var(--ink) 40%, #3d5a6e 70%, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(47, 158, 144, 0.15);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--muted);
  max-width: 28ch;
}

.hero p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 42ch;
}

.modules-visual {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-height: 300px;
  perspective: 900px;
}

.mod {
  border-radius: 10px;
  border: 1.5px solid var(--blue);
  background: linear-gradient(145deg, #f8fafc, #cfdbe6);
  box-shadow:
    10px -8px 0 #9eb0c0,
    10px -8px 0 1.5px var(--blue),
    0 20px 36px rgba(28, 36, 46, 0.16);
  animation: rise 0.85s ease both;
  transform: rotateX(8deg) rotateY(-8deg);
  transform-style: preserve-3d;
}

.mod:nth-child(1) {
  height: 120px;
  align-self: end;
  animation-delay: 0.05s;
  background: linear-gradient(145deg, #f5f8fa, #d5e4ee);
}
.mod:nth-child(2) {
  height: 190px;
  align-self: end;
  animation-delay: 0.12s;
  background: linear-gradient(145deg, #eef8f5, #b9d9d2);
  box-shadow:
    10px -8px 0 #8fb5ad,
    10px -8px 0 1.5px var(--blue),
    var(--glow);
}
.mod:nth-child(3) {
  height: 150px;
  align-self: end;
  animation-delay: 0.18s;
  background: linear-gradient(145deg, #fff8ef, #e8d0a8);
  box-shadow:
    10px -8px 0 #c9ae7e,
    10px -8px 0 1.5px var(--blue),
    var(--glow-accent);
}
.mod:nth-child(4) {
  height: 210px;
  align-self: end;
  animation-delay: 0.24s;
  background: linear-gradient(145deg, #eef2f6, #a8b8c6);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px) rotateX(8deg) rotateY(-8deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(8deg) rotateY(-8deg) scale(1);
  }
}

.section {
  padding: 56px 0;
}

.section h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0 0 8px;
}

.section .lead {
  color: var(--muted);
  margin: 0 0 28px;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature {
  background: linear-gradient(145deg, #fbfcfd, #eef2f6);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 6px 6px 0 rgba(42, 69, 88, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(42, 69, 88, 0.14), var(--glow);
}

.feature .num {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
  box-shadow: 3px 3px 0 var(--accent);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-family: var(--display);
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.cta-band {
  margin: 20px 0 60px;
  padding: 36px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2a4558 0%, #355f6f 55%, #2f9e90 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 10px 10px 0 rgba(28, 36, 46, 0.2), var(--glow);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.cta-band h2 {
  margin: 0 0 6px;
  font-family: var(--display);
}

.cta-band p {
  margin: 0;
  opacity: 0.9;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Constructor layout */
.page-constructor {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-constructor .site-header--compact .inner {
  min-height: 52px;
}

.page-constructor .site-header--compact {
  flex-shrink: 0;
}

.constructor-app {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 14px;
  min-height: calc(100vh - 84px);
  padding: 14px;
}

.constructor-app--stage {
  grid-template-columns: 1fr min(300px, 28vw);
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 10px 12px 12px;
  gap: 10px;
  overflow: hidden;
}

.panel {
  background: linear-gradient(145deg, #fbfcfd, #eef2f6);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
  box-shadow: 6px 6px 0 rgba(42, 69, 88, 0.1);
}

.aside-panel {
  min-height: 0;
  overflow: auto;
}

.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
  padding: 10px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-family: var(--display);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
}

.toolbar--compact {
  gap: 6px;
  flex-shrink: 0;
}


.stage-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 22px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.stage-tools {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(168px, 42vw);
  pointer-events: none;
}

.stage-tool,
.stage-tool-pop {
  pointer-events: auto;
}

.stage-tool {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 40px;
  padding: 4px 8px 4px 4px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgba(251, 252, 253, 0.96);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(42, 69, 88, 0.1);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.stage-tool__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e8eef3;
  display: grid;
  place-items: center;
  color: #2a4558;
}

.stage-tool__icon svg {
  width: 18px;
  height: 18px;
}

.stage-tool__label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.stage-tool:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(42, 69, 88, 0.12);
  background: #fff;
}

.stage-tool:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.stage-tool--accent .stage-tool__icon {
  background: #d7eef0;
  color: #17665d;
}

.stage-tool--accent {
  border-color: #2a9d8f;
}

.stage-tool--danger .stage-tool__icon {
  background: #f3e4e4;
  color: #8a3d3d;
}

.stage-tool--danger {
  border-color: #c47a7a;
}

.stage-tool.is-open {
  background: #fff;
  box-shadow: 4px 4px 0 rgba(42, 69, 88, 0.14);
}

.stage-tool-pop {
  position: relative;
}

.stage-tool-pop__panel {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  z-index: 18;
  min-width: 230px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbfcfd;
  box-shadow: 6px 6px 0 rgba(42, 69, 88, 0.12);
  display: grid;
  gap: 8px;
}

.stage-tool-pop__panel[hidden] {
  display: none !important;
}

.tool-pop__title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.room-pop label {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
}

.room-pop input {
  width: 72px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-weight: 700;
}

.room-fields {
  display: none;
}

.stage-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.canvas-wrap {
  background:
    radial-gradient(ellipse at 50% 10%, rgba(47, 158, 144, 0.1), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(224, 154, 58, 0.06), transparent 40%),
    linear-gradient(180deg, #eef2f6 0%, #d8e0e8 100%);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  min-height: 0;
  flex: 1;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(42, 69, 88, 0.06);
}

.canvas-wrap--iso {
  cursor: grab;
}

.canvas-wrap--iso:active {
  cursor: grabbing;
}

.view-controls {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 6;
  display: grid;
  grid-template-columns: 42px 42px;
  gap: 6px;
  align-items: stretch;
}

.view-btn--wide {
  grid-column: 1 / -1;
  width: auto;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
}

.view-btn__caption {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.view-btn--wide svg {
  width: 18px;
  height: 18px;
}

.view-btn.is-armed {
  background: #d7eef0;
  border-color: #2a9d8f;
  color: #17665d;
}

.view-btn {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: rgba(251, 252, 253, 0.95);
  box-shadow: 3px 3px 0 rgba(42, 69, 88, 0.12);
  color: var(--blue);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.view-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.view-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(42, 69, 88, 0.16), var(--glow);
}

.view-btn:active {
  transform: translate(1px, 1px);
}

.ctx-menu {
  position: absolute;
  z-index: 12;
  min-width: 180px;
  padding: 8px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fbfcfd;
  box-shadow: 6px 6px 0 rgba(42, 69, 88, 0.14), var(--glow);
  display: grid;
  gap: 4px;
}

.ctx-menu[hidden] {
  display: none !important;
}

.ctx-menu__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 8px 6px;
}

.ctx-menu button {
  border: 0;
  background: #eef2f6;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.ctx-menu button:hover {
  background: #dce8ef;
}

.ctx-menu__cancel {
  opacity: 0.75;
  margin-top: 2px;
}

#kitchen-svg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  touch-action: none;
}

.stage-footer--compact {
  flex-shrink: 0;
  padding-top: 2px;
}

.unit {
  cursor: grab;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.unit:active,
.unit.dragging {
  cursor: grabbing;
}

.unit.selected .face-front {
  filter: drop-shadow(0 0 8px rgba(42, 157, 143, 0.75));
}

.unit.selected {
  filter: drop-shadow(0 0 10px rgba(224, 154, 58, 0.45));
}

.unit-label {
  font-size: 11px;
  font-weight: 700;
  fill: #3a4a58;
  pointer-events: none;
}

.add-module-btn {
  position: absolute;
  right: 18px;
  bottom: 18px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 92px;
  z-index: 5;
  transition: transform 0.18s ease;
}

.add-module-btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.add-module-btn__box {
  width: 78px;
  height: 92px;
  border-radius: 8px;
  background: linear-gradient(145deg, #f7fbfc 0%, #d9e8ef 55%, #c5d8e4 100%);
  border: 2px solid #2a4558;
  box-shadow:
    8px -6px 0 #9fb8c8,
    8px -6px 0 2px #2a4558,
    0 12px 24px rgba(30, 77, 107, 0.22),
    var(--glow);
}

.add-module-btn__plus {
  position: absolute;
  top: 28px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}

.add-module-btn__label {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  text-align: center;
}

.picker {
  position: absolute;
  inset: 16px;
  z-index: 8;
  background: rgba(244, 246, 249, 0.96);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pickerIn 0.22s ease;
  box-shadow: var(--shadow-block);
}

.picker[hidden] {
  display: none !important;
}

@keyframes pickerIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.picker__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.picker__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  flex: 1;
}

.picker__back,
.picker__close {
  border: 0;
  background: #e2e8ef;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.picker__close {
  width: 36px;
  font-size: 1.2rem;
}

.picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  overflow: auto;
  padding-bottom: 4px;
  flex: 1;
}

.picker__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.picker__hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.picker-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, #eef2f6);
  padding: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  display: grid;
  gap: 8px;
  position: relative;
  box-shadow: 4px 4px 0 rgba(42, 69, 88, 0.08);
}

.picker-card:hover {
  transform: translate(-2px, -2px);
  border-color: #8fb0c2;
  box-shadow: 6px 6px 0 rgba(42, 69, 88, 0.12), var(--glow);
}

.picker-card--check.is-checked {
  border-color: var(--teal);
  box-shadow: 6px 6px 0 rgba(47, 158, 144, 0.2), var(--glow);
}

.picker-card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: #fff;
}

.picker-card--check.is-checked .picker-card__check {
  background: var(--teal);
  border-color: var(--teal-dark);
  box-shadow: inset 0 0 0 3px #fff;
}

.picker-card__visual {
  height: 72px;
  border-radius: 8px;
  position: relative;
  background: linear-gradient(145deg, #f7fbfc, #cfe0ea);
  border: 1.5px solid #2a4558;
  box-shadow: 6px -4px 0 #a9c0cf, 6px -4px 0 1.5px #2a4558;
  overflow: hidden;
}

.picker-card__visual--photo {
  height: 110px;
  background: #e8eef3;
  box-shadow: none;
  border: 1.5px solid var(--line);
}

.picker-card__visual--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.picker-card__visual.upper,
.picker-card__visual.antresol {
  height: 52px;
  background: linear-gradient(145deg, #eef8f6, #b7d9d3);
}

.picker-card__visual.tall {
  height: 96px;
  background: linear-gradient(145deg, #f0f3f7, #b8c5d0);
}

.picker-card__visual[data-kind="sink"]::after {
  content: "";
  position: absolute;
  inset: 28% 18% 22% 18%;
  border-radius: 4px;
  background: #9eb6c8;
  border: 1px solid #5a7288;
}

.picker-card__visual[data-kind="dryer"]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid #2a4558;
  opacity: 0.55;
}

.picker-card__title {
  font-weight: 700;
  font-size: 0.92rem;
}

.picker-card__meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.stage-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.stage-footer__label {
  font-weight: 700;
  margin-bottom: 8px;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.legend i {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  border: 1.5px solid #2a4558;
}

.legend .lg-lower {
  background: #dceeea;
}

.legend .lg-wall {
  background: rgba(90, 110, 130, 0.35);
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line), 3px 3px 0 rgba(42, 69, 88, 0.12);
  cursor: pointer;
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--teal), var(--glow);
}

.totals {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.totals .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.95rem;
}

.totals .sum {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--display);
}

.draft-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.form label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.form textarea {
  min-height: 80px;
  resize: vertical;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.25s ease;
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  box-shadow: var(--glow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

/* Admin */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.admin-nav {
  background: linear-gradient(180deg, #2a4558, #1c2e3a);
  color: #fff;
  padding: 20px 14px;
}

.admin-nav a,
.admin-nav button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  cursor: pointer;
  font: inherit;
}

.admin-nav a.active,
.admin-nav button.active,
.admin-nav a:hover,
.admin-nav button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.admin-main {
  padding: 20px;
}

.login-box {
  width: min(400px, calc(100% - 32px));
  margin: 12vh auto;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-block);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 0.92rem;
}

.editor-block {
  border: 1.5px dashed #c5d3de;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}

.price-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
}

.price-toolbar input[type="search"],
.price-toolbar select {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  min-width: 180px;
}

.price-toolbar .chk {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 0.92rem;
  color: var(--muted);
}

.dirty-flag {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.price-table-wrap {
  max-height: calc(100vh - 220px);
  overflow: auto;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-block);
}

.price-table thead th {
  position: sticky;
  top: 0;
  background: #eef2f6;
  z-index: 1;
}

.price-input {
  width: 120px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--glow);
}

.color-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.color-admin-card {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.color-admin-card__swatch {
  height: 56px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  box-shadow: 4px 4px 0 rgba(42, 69, 88, 0.12);
}

.hex-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
}

@media (max-width: 980px) {
  .page-constructor {
    height: auto;
    overflow: auto;
  }

  .hero-grid,
  .feature-row,
  .constructor-app,
  .constructor-app--stage,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .modules-visual {
    min-height: 180px;
  }

  .constructor-app {
    min-height: auto;
  }

  .constructor-app--stage {
    height: auto;
    overflow: visible;
  }

  .stage-panel {
    min-height: 70vh;
  }

  .canvas-wrap,
  #kitchen-svg {
    min-height: 360px;
  }

  .hero .brand-hero {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .room-fields {
    width: 100%;
    margin-left: 0;
  }
}
