@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&display=swap');

:root {
  --dn-ink: #1f2933;
  --dn-muted: #667085;
  --dn-soft: #f3efe7;
  --dn-paper: #fffaf0;
  --dn-card: rgba(255, 255, 255, 0.86);
  --dn-border: rgba(43, 35, 25, 0.12);
  --dn-accent: #c87941;
  --dn-accent-2: #315f52;
  --dn-accent-3: #ebc86a;
  --dn-danger: #b8463c;
  --dn-shadow: 0 22px 60px rgba(43, 35, 25, 0.14);
  --dn-radius: 16px;
  /* Enhanced UI variables */
  --dn-bg-deep: #0d0d14;
  --dn-bg-panel: rgba(18, 18, 30, 0.97);
  --dn-bg-card: rgba(255, 255, 255, 0.04);
  --dn-bg-hover: rgba(255, 255, 255, 0.08);
  --dn-glass: rgba(255, 255, 255, 0.03);
  --dn-glow-accent: 0 0 20px rgba(200, 121, 65, 0.15);
  --dn-glow-green: 0 0 20px rgba(49, 95, 82, 0.3);
  --dn-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --dn-transition-fast: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --dn-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --dn-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --dn-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --dn-text-primary: #f1f5f9;
  --dn-text-secondary: rgba(255, 255, 255, 0.6);
  --dn-text-tertiary: rgba(255, 255, 255, 0.35);
  --dn-border-subtle: rgba(255, 255, 255, 0.06);
  --dn-border-hover: rgba(255, 255, 255, 0.15);
}

/* ====== FULLSCREEN MODE (без WordPress chrome) ====== */

body, html {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background: #121218 !important;
}

#wpadminbar { display: none !important; }

/* Скрываем WordPress header/footer если вдруг подключены */
.site-header, .site-footer, #masthead, #colophon {
  display: none !important;
}

body.designer-next-page {
  display: block !important;
}

/* ====== Shell — full screen ====== */
.dn-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #121218;
  color: var(--dn-ink);
  font-family: "Onest", "Segoe UI", sans-serif;
  overflow: hidden;
}

/* Fallback aliases for old class names */
.dn-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ====== TOP BAR ====== */
.dn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  min-height: 52px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(25, 25, 45, 0.98) 0%, rgba(18, 18, 35, 0.95) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255,255,255,0.03) inset;
  flex-shrink: 0;
  z-index: 100;
}

/* Topbar inner row */
.dn-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.dn-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dn-brand-link {
  color: #fff;
  background: #c87941;
  padding: 4px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dn-brand-link:hover {
  background: #b56a35;
  transform: scale(1.03);
}

.dn-brand-link:active {
  transform: scale(0.98);
}

.dn-topbar-left,
.dn-topbar-center,
.dn-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dn-topbar-center {
  flex: 1;
  justify-content: center;
}

.dn-logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--dn-accent);
  letter-spacing: 0.05em;
}

.dn-divider {
  color: rgba(255,255,255,0.2);
  font-size: 14px;
}

/* View toggle in topbar */
.dn-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.dn-view-toggle button {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dn-view-toggle button:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}

.dn-view-toggle button.is-active {
  background: var(--dn-accent-2);
  color: #fff;
}

/* Room controls in topbar */
.dn-room-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.dn-room-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.dn-room-controls input[type="number"] {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  text-align: right;
}

.dn-room-controls input[type="number"]:focus {
  border-color: var(--dn-accent);
  box-shadow: 0 0 0 3px rgba(200,121,65,0.2);
}

/* Topbar buttons */
.dn-topbar-right button {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--dn-transition);
  position: relative;
  overflow: hidden;
}

.dn-topbar-right button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.1), transparent 70%);
  opacity: 0;
  transition: var(--dn-transition);
}

.dn-topbar-right button:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--dn-shadow-sm);
}

.dn-topbar-right button:hover::after {
  opacity: 1;
}

.dn-topbar-right button:active {
  transform: translateY(0) scale(0.97);
  transition: var(--dn-transition-fast);
}

/* 3D export button — orange accent */
.dn-topbar-right .dn-export-btn {
  background: rgba(200, 121, 65, 0.2);
  border-color: rgba(200, 121, 65, 0.4);
  color: #f0a860;
}
.dn-topbar-right .dn-export-btn:hover {
  background: rgba(200, 121, 65, 0.35);
  border-color: rgba(200, 121, 65, 0.6);
  color: #ffc080;
}

/* ====== WORKBENCH — двухколоночный layout ====== */
.dn-workbench {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ====== LEFT PANEL (каталог + спецификация) ====== */
.dn-panel {
  width: 320px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  background: rgba(25, 25, 40, 0.95);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  flex-shrink: 0;
}

/* Sidebar alias for old class name */
.dn-sidebar {
  width: 320px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  background: rgba(25, 25, 40, 0.95);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  flex-shrink: 0;
}

/* Sidebar header */
.dn-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.15);
}

.dn-sidebar-header .dn-kicker {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dn-sidebar-header button {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.dn-sidebar-header button:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}

/* Tabs in left panel */
.dn-tabs-top {
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.15);
}

.dn-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.dn-tab-btn:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.03);
}

.dn-tab-btn.is-active {
  color: #fff;
  border-bottom-color: var(--dn-accent);
  background: rgba(255,255,255,0.04);
}

/* Tab content visibility */
.dn-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.dn-tab-content.is-active {
  display: flex;
  flex-direction: column;
}

/* ====== Catalog panel ====== */
.dn-search-wrap,
.dn-sidebar .dn-search {
  padding: 12px 14px;
}

.dn-search-wrap input,
.dn-sidebar .dn-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: var(--dn-text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--dn-transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='rgba(255,255,255,0.3)' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.13A6.5 6.5 0 1 0 8 13.5a6.47 6.47 0 0 0 4.39 1.63l.28.27.79.79 4.25 4.25 1.41-1.41z'/%3E%3Ccircle cx='9' cy='9' r='4' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}

.dn-search-wrap input::placeholder,
.dn-sidebar .dn-search input::placeholder {
  color: rgba(255,255,255,0.25);
}

.dn-search-wrap input:focus,
.dn-sidebar .dn-search input:focus {
  border-color: var(--dn-accent);
  background-color: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 4px rgba(200,121,65,0.12), var(--dn-glow-accent);
}

.dn-search-wrap input:hover:not(:focus),
.dn-sidebar .dn-search input:hover:not(:focus) {
  border-color: rgba(255,255,255,0.15);
  background-color: rgba(255,255,255,0.06);
}

/* Width groups (legacy) */
.dn-width-groups {
  display: none; /* Hidden — JS populates dn-catalog-list directly */
}

/* Categories (legacy) */
.dn-categories {
  display: none; /* Hidden — JS populates dn-catalog-list directly */
}

/* ====== Catalog panel (legacy styles, kept for compatibility) ====== */
.dn-tabs-categories {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dn-tabs-categories button {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.dn-tabs-categories button:hover {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
}

.dn-tabs-categories button.is-active {
  background: var(--dn-accent);
  border-color: var(--dn-accent);
  color: #fff;
}

/* Catalog list */
.dn-catalog-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

/* Custom scrollbar for catalog */
.dn-catalog-list::-webkit-scrollbar {
  width: 6px;
}
.dn-catalog-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px;
}
.dn-catalog-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  transition: background 0.2s;
}
.dn-catalog-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

/* Global custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

.dn-item {\n  display: grid;\n  grid-template-columns: 60px minmax(0, 1fr) auto;\n  gap: 10px;\n  padding: 12px;\n  border: 1px solid var(--dn-border-subtle);\n  border-radius: 14px;\n  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);\n  cursor: pointer;\n  transition: var(--dn-transition);\n  text-align: left;\n  color: inherit;\n  font-family: inherit;\n  align-items: center;\n  position: relative;\n  overflow: hidden;\n}\n\n.dn-item::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  background: linear-gradient(135deg, rgba(200, 121, 65, 0.08) 0%, transparent 60%);\n  opacity: 0;\n  transition: var(--dn-transition);\n  pointer-events: none;\n}\n\n.dn-item:hover {\n  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%);\n  border-color: var(--dn-border-hover);\n  transform: translateY(-2px);\n  box-shadow: var(--dn-shadow-md), var(--dn-glow-accent);\n}\n\n.dn-item:hover::before {\n  opacity: 1;\n}\n\n.dn-item:active {\n  transform: translateY(0) scale(0.99);\n  transition: var(--dn-transition-fast);\n}\n\n@keyframes itemAppear {\n  from { opacity: 0; transform: translateY(8px); }\n  to { opacity: 1; transform: translateY(0); }\n}\n\n.dn-item {\n  animation: itemAppear 0.3s ease-out both;\n}\n\n.dn-catalog-list .dn-item:nth-child(1) { animation-delay: 0ms; }\n.dn-catalog-list .dn-item:nth-child(2) { animation-delay: 20ms; }\n.dn-catalog-list .dn-item:nth-child(3) { animation-delay: 40ms; }\n.dn-catalog-list .dn-item:nth-child(4) { animation-delay: 60ms; }\n.dn-catalog-list .dn-item:nth-child(n+5) { animation-delay: 80ms; }

.dn-item-thumb {
  width: 72px;
  height: 56px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}

.dn-item:hover .dn-item-thumb {
  background: rgba(255,255,255,0.1);
  border-color: rgba(200, 121, 65, 0.3);
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

.dn-item-thumb svg {
  width: 100%;
  height: 100%;
}

.dn-item-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f3ddbb, #d7b282);
  color: #5b3d24;
  font-weight: 800;
  font-size: 14px;
}

.dn-item h3 {
  margin: 0 0 2px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  color: #fff;
}

.dn-item p {
  margin: 0;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  line-height: 1.3;
}

.dn-item-price {
  color: #f0c080;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  align-self: center;
  justify-self: end;
  padding: 4px 8px;
  background: rgba(240, 192, 128, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(240, 192, 128, 0.2);
}

.dn-item-meta {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.dn-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(49, 95, 82, 0.2);
  color: #7dd3b0;
  font-size: 10px;
  font-weight: 700;
}

/* ====== Spec panel (in left panel) ====== */
.dn-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px;
}

.dn-metrics div {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  text-align: center;
}

.dn-metrics span {
  display: block;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dn-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.02em;
}

.dn-total {
  color: var(--dn-accent-3) !important;
  font-size: 18px !important;
}

.dn-selection {
  margin: 0 12px 12px;
  padding: 12px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}

.dn-selection p {
  margin: 0;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

.dn-materials {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dn-materials label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dn-materials label span {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dn-materials select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.dn-spec {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

/* ====== STAGE (center area) ====== */
/* По умолчанию все стадии скрыты */
.dn-stage {
  flex: 1;
  display: none;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: #0e0e16;
}

/* Активная стадия — показываем */
.dn-stage.dn-active {
  display: flex;
}

/* Скрываем подсказку активной стадии */
.dn-stage.dn-active .dn-hint {
  display: block;
}
.dn-hint {
  display: none;
}

/* Stage header alias for old class name */
.dn-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(30, 30, 50, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* Toolbar in stage */
.dn-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(30, 30, 50, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 40px;
  flex-shrink: 0;
}

/* Room info in toolbar */
.dn-room-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}

.dn-room-info label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

.dn-room-info input[type="number"] {
  width: 56px;
  padding: 3px 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  text-align: right;
}

.dn-room-info input[type="number"]:focus {
  border-color: var(--dn-accent);
}

/* Presets in toolbar */
.dn-presets-mini button {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.dn-presets-mini button:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

/* Separator */
.dn-sep {
  color: rgba(255,255,255,0.15);
  font-size: 14px;
  user-select: none;
}

.dn-toolbar button {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.dn-toolbar button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ====== Canvas areas ====== */
.dn-canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#dn-plan,
#dn-three {
  display: block;
  width: 100%;
  height: 100%;
}

#dn-three canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dn-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(31, 41, 51, 0.7);
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* ====== Modal ====== */
.dn-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(10px);
}

.dn-modal[hidden] {
  display: none;
}

.dn-modal-card {
  width: min(480px, 100%);
  padding: 24px;
  border-radius: 20px;
  background: #1e1e30;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dn-modal-card h2 {
  margin: 0;
  font-size: 22px;
}

.dn-modal-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dn-modal-card input,
.dn-modal-card textarea {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.dn-modal-card input:focus,
.dn-modal-card textarea:focus {
  border-color: var(--dn-accent);
}

.dn-modal-close {
  align-self: flex-end;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
}

.dn-primary {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: var(--dn-accent-2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.dn-primary:hover {
  background: #24493f;
}

/* ====== Hidden utility ====== */
.dn-hidden {
  display: none !important;
}
.dn-active {
  display: flex !important;
}

/* ====== Scrollbar styling ====== */
.dn-catalog-list::-webkit-scrollbar,
.dn-spec::-webkit-scrollbar,
.dn-search input::-webkit-scrollbar {
  width: 4px;
}
/* Category filter buttons */
.dn-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dn-cat-btn {
  background: rgba(255,255,255,0.08);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.dn-cat-btn:hover {
  background: rgba(200,121,65,0.2);
  color: #fff;
}

.dn-cat-btn.is-active {
  background: #c87941;
  color: #fff;
  border-color: #c87941;
  font-weight: 600;
}

.dn-cat-btn[data-category="wall"]:is-active,
.dn-cat-btn[data-category="stove"],
.dn-cat-btn[data-category="corner_wall"] {
  background: rgba(122,167,150,0.3);
  border-color: rgba(122,167,150,0.5);
}

.dn-cat-btn[data-category="wall"].is-active,
.dn-cat-btn[data-category="stove"].is-active,
.dn-cat-btn[data-category="corner_wall"].is-active {
  background: #7aa796;
  border-color: #7aa796;
}

.dn-cat-btn[data-category="tall"] {
  background: rgba(155,122,189,0.3);
  border-color: rgba(155,122,189,0.5);
}

.dn-cat-btn[data-category="tall"].is-active {
  background: #9b7abd;
  border-color: #9b7abd;
}



.dn-catalog-list::-webkit-scrollbar-track,
.dn-spec::-webkit-scrollbar-track {
  background: transparent;
}

.dn-catalog-list::-webkit-scrollbar-thumb,
.dn-spec::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .dn-panel {
    width: 260px;
    min-width: 220px;
  }
  .dn-room-controls input[type="number"] {
    width: 50px;
  }
}

@media (max-width: 700px) {
  .dn-panel {
    width: 100%;
    max-width: 100%;
    position: absolute;
    z-index: 50;
    height: calc(100vh - 48px);
    top: 48px;
  }
  .dn-stage {
    width: 100%;
  }
}

/* Layout wrapper */
.dn-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

@media (max-width: 700px) {
  .dn-topbar {
    gap: 8px;
    padding: 0 8px;
  }

  .dn-topbar-left,
  .dn-topbar-center,
  .dn-topbar-right {
    gap: 6px;
  }

  .dn-brand {
    display: none;
  }

  .dn-room-input {
    font-size: 11px;
  }

  .dn-room-input input {
    width: 58px;
  }

  .dn-layout {
    flex-direction: column;
    min-height: 0;
  }

  .dn-sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 42vh;
    flex: 0 0 42vh;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .dn-workspace {
    width: 100%;
    min-width: 0;
    min-height: 240px;
    flex: 1 1 auto;
  }

  .dn-stage,
  #dn-three,
  #dn-three canvas,
  #dn-plan {
    min-width: 0;
    width: 100%;
  }
}

/* ====== Toast Notifications ====== */
.dn-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(30, 30, 40, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: "Onest", "Segoe UI", sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 10000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 90vw;
  text-align: center;
}

.dn-toast.dn-toast--success {
  background: rgba(46, 125, 50, 0.95);
  border-color: rgba(76, 175, 80, 0.3);
}

.dn-toast.dn-toast--error {
  background: rgba(183, 28, 28, 0.95);
  border-color: rgba(244, 67, 54, 0.3);
}

/* ====== Selection Highlight ====== */
.dn-selection h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.dn-selection p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.4;
}

.dn-selection .dn-chip {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-right: 4px;
}

.dn-action-hints {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dn-action-hints .dn-chip {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(200, 121, 65, 0.15);
  color: #c87941;
  border: 1px solid rgba(200, 121, 65, 0.2);
}

/* ====== Catalog Item Hover ====== */
.dn-catalog-item:hover {
  background: rgba(200, 121, 65, 0.1) !important;
  border-color: rgba(200, 121, 65, 0.3) !important;
}

.dn-catalog-item[data-add]:active {
  transform: scale(0.98);
}

/* ====== Drag Overlay ====== */
.dn-dragover {
  outline: 2px dashed rgba(200, 121, 65, 0.6) !important;
  outline-offset: -2px;
}

/* ====== Module Selection Glow ====== */
.dn-selection-active {
  box-shadow: 0 0 0 2px rgba(200, 121, 65, 0.4);
}

/* ====== Material Selectors (фасады / столешницы) ====== */
.dn-material-section {
  padding: 8px 0;
}

.dn-material-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

.dn-material-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
  transition: border-color 0.15s;
}

.dn-material-select:hover {
  border-color: rgba(255,255,255,0.2);
}

.dn-material-select:focus {
  border-color: var(--dn-accent);
  box-shadow: 0 0 0 3px rgba(200,121,65,0.15);
}

.dn-material-select option {
  background: #1a1a2e;
  color: #fff;
  padding: 4px;
}


/* Materials panel */
.dn-materials-panel {
    padding: 12px;
}

.dn-materials-panel h3 {
    margin: 8px 0;
    font-size: 14px;
    color: #315f52;
}

.dn-materials-panel select {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
}

.dn-materials-panel label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #6b7280;
}


/* Animations and Transitions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.dn-animate-fade {
  animation: fadeIn 0.3s ease-out;
}

.dn-animate-slide {
  animation: slideIn 0.3s ease-out;
}

.dn-animate-pulse {
  animation: pulse 0.5s ease-in-out;
}

.dn-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #315f52;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Module hover effects */
.dn-item {
  transition: all 0.2s ease;
}

.dn-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(49, 95, 82, 0.15);
}

/* Canvas module hover */
.dn-module-hover {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.dn-module-hover:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(49, 95, 82, 0.4);
}

/* Button hover effects */
.dn-icon-btn {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.dn-icon-btn:hover {
  transform: scale(1.1);
  background-color: #e2e8f0;
}

.dn-cat-btn {
  transition: all 0.2s ease;
}

.dn-cat-btn:hover {
  transform: scale(1.05);
}

/* Tab switch animation */
.dn-catalog-panel, .dn-spec-panel, .dn-materials-panel {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.dn-catalog-panel.dn-visible {
  animation: fadeIn 0.3s ease-out;
}

.dn-spec-panel.dn-visible {
  animation: slideIn 0.3s ease-out;
}

.dn-materials-panel.dn-visible {
  animation: fadeIn 0.3s ease-out;
}

/* Toast notification animation */
.dn-toast {
  animation: slideIn 0.3s ease-out;
  transition: opacity 0.3s ease;
}

/* Drop zone visual feedback */
.dn-dragover {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Selected module highlight */
.dn-selected {
  animation: pulse 1s ease-in-out infinite;
}

/* Price display animation */
.dn-price {
  transition: color 0.3s ease;
}

.dn-price:hover {
  color: #315f52;
}

/* Total price highlight */
.dn-spec-total {
  animation: pulse 2s ease-in-out infinite;
  font-size: 16px;
  font-weight: bold;
  color: #315f52;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  margin: 12px 0;
}
