:root {
  --topbar-bg: #ffffff;
  --topbar-border: #dde3ee;
  --text-main: #131a2a;
  --text-muted: #7c879d;
  --help-bg: #ffffff;
  --help-border: #e5e9f1;
  --primary: #1f61e8;
  --primary-hover: #1756d3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text-main);
  background: #f3f5f9;
  min-height: 100vh;
}

.topbar {
  height: 77.4px;
  padding: 0 21.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--topbar-bg);
  border-bottom: 0.9px solid var(--topbar-border);
}

.topbar-title {
  margin: 0;
  font-size: 28.8px;
  font-weight: 700;
  line-height: 1;
}

.topbar-brand {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 10px;
}

.topbar-logo {
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
}

.topbar-logo-link {
  height: 100%;
  display: inline-flex;
  align-items: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10.8px;
}

.topbar-btn {
  height: 41.4px;
  padding: 0 18px;
  border-radius: 899.1px;
  border: 0.9px solid transparent;
  background: transparent;
  color: #24314a;
  display: inline-flex;
  align-items: center;
  gap: 8.1px;
  font-size: 15.3px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease, filter .15s ease;
}

.topbar-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(23, 39, 66, 0.2);
  filter: saturate(1.08);
}

.topbar-btn svg {
  width: 15.3px;
  height: 15.3px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.topbar-btn-save {
  background: var(--help-bg);
  border-color: var(--help-border);
  box-shadow: 0 1.8px 7.2px rgba(17, 24, 39, 0.06);
  color: var(--primary);
  padding: 0 16.2px;
  font-weight: 500;
}

.topbar-btn-save:hover {
  background: #edf4ff;
  border-color: #b8cbef;
  box-shadow: 0 10px 18px rgba(31, 97, 232, 0.22);
}

.topbar-btn-help {
  background: var(--help-bg);
  border-color: var(--help-border);
  box-shadow: 0 1.8px 7.2px rgba(17, 24, 39, 0.06);
}

.topbar-btn-help:hover {
  background: #edf4ff;
  border-color: #b8cbef;
  box-shadow: 0 10px 18px rgba(31, 97, 232, 0.18);
}

.topbar-btn-export {
  background: var(--primary);
  color: #ffffff;
  padding: 0 21.6px;
  box-shadow: 0 7.2px 14.4px rgba(31, 97, 232, 0.24);
}

.topbar-btn-export:hover {
  background: #0f4ed1;
  box-shadow: 0 12px 22px rgba(31, 97, 232, 0.36);
}

.app-layout {
  padding: 14.4px;
  min-height: calc(100vh - 77.4px);
}

.workspace-top {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 14.4px;
  align-items: start;
  margin-bottom: 12.6px;
}

.workspace-main {
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 14.4px;
  align-items: start;
}

.export-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 30, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
}

.export-modal-backdrop.open {
  display: flex;
}

.export-modal {
  width: min(960px, 94vw);
  height: min(90vh, 860px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(9, 16, 28, 0.3);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 16px;
  gap: 12px;
}

.export-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.export-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1b2940;
  margin: 0;
}

.export-close {
  border: 0;
  background: #eef2fa;
  color: #2a3b57;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.export-preview-wrap {
  background: #f4f7fc;
  border-radius: 16px;
  border: 1px solid #dce4f1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 10px;
}

.export-page-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.export-nav-btn {
  border: 1px solid #cbd6e9;
  background: #ffffff;
  color: #24314a;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

.export-page-meta {
  font-size: 14px;
  font-weight: 600;
  color: #415374;
  min-width: 180px;
  text-align: center;
}

.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.help-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 30, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 130;
}

.help-modal-backdrop.open {
  display: flex;
}

.help-modal {
  width: min(980px, 94vw);
  height: min(86vh, 820px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 22px 52px rgba(9, 16, 28, 0.34);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #dce4f1;
  background: #f6f9ff;
}

.help-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1b2940;
}

.help-close {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e9eef8;
  color: #2a3b57;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.help-body {
  overflow: auto;
  padding: 16px 18px 18px;
  color: #1f2f4d;
  font-size: 15px;
  line-height: 1.45;
}

.help-section {
  margin-bottom: 14px;
  border: 1px solid #dce5f4;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
}

.help-section h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #17325f;
}

.help-section p {
  margin: 0 0 6px 0;
}

.new-project-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.36);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

.new-project-backdrop.open {
  display: flex;
}

.new-project-modal {
  width: min(420px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 18px;
  box-shadow: 0 20px 42px rgba(16, 24, 40, 0.22);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.new-project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.new-project-actions .topbar-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}

.new-project-option {
  position: relative;
}

.new-project-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: 300px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #c8d5ec;
  background: #f8fbff;
  color: #22314d;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.14);
  display: none;
  z-index: 3;
}

.new-project-option:hover .new-project-tip {
  display: block;
}

.import-preview-body {
  border: 1px solid #d8e1ef;
  border-radius: 12px;
  background: #f8fbff;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.import-preview-empty {
  color: #5d6a82;
  font-size: 14px;
  text-align: center;
  padding: 12px;
}

.import-preview-media {
  width: 100%;
  height: 100%;
  min-height: 260px;
  border: 0;
  object-fit: contain;
  background: #ffffff;
}

.import-preview-actions {
  display: flex;
  justify-content: flex-end;
}

.import-status-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.36);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.import-status-backdrop.open {
  display: flex;
}

.import-status-modal {
  width: min(460px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 18px;
  box-shadow: 0 20px 42px rgba(16, 24, 40, 0.22);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.import-status-text {
  color: #1f2f4d;
  font-size: 14px;
}

.import-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e7edf8;
  overflow: hidden;
  border: 1px solid #d2dced;
}

.import-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2f6ff0, #1f61e8);
  transition: width .16s linear;
}

.import-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #44536f;
}

.import-status-actions {
  display: flex;
  justify-content: flex-end;
}

.import-status-details {
  display: none;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #d5deed;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #24324c;
  white-space: pre-wrap;
  word-break: break-word;
}

.quote-request-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 30, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 130;
}

.quote-request-backdrop.open {
  display: flex;
}

.quote-request-modal {
  width: min(520px, 94vw);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(9, 16, 28, 0.3);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.quote-request-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #44536f;
}

.quote-request-field {
  display: grid;
  gap: 4px;
}

.quote-request-status {
  font-size: 13px;
  line-height: 1.4;
  min-height: 18px;
  color: #44536f;
}

.quote-request-status.success {
  color: #1f8a4c;
}

.quote-request-status.error {
  color: #c0392b;
}

.quote-request-actions {
  display: flex;
  justify-content: flex-end;
}

.editor-shell {
  min-height: clamp(520px, 68vh, 760px);
  border: 0.9px solid #e4e9f2;
  border-radius: 21.6px;
  background: #ffffff;
  box-shadow: 0 7.2px 18px rgba(27, 40, 66, 0.06);
  padding: 14.4px;
  position: relative;
}

.editor-tools-floating {
  display: none;
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 35;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 0.9px solid #d6ddea;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.editor-tools-floating .tool-item {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 9px;
  justify-content: center;
}

.editor-tools-floating .tool-item span {
  display: none;
}

.editor-canvas {
  width: 100%;
  min-height: clamp(490px, 64vh, 730px);
  border: 0.9px dashed #d8e0ed;
  border-radius: 16.2px;
  background:
    radial-gradient(circle at 0.9px 0.9px, #dfe6f2 0.9px, transparent 0) 0 0/18px 18px,
    #fbfcff;
  position: relative;
  overflow: hidden;
}

.editor-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("Logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% auto;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

.editor-canvas.grid-hidden {
  background: #fbfcff;
}

.editor-canvas.dimensions-hidden .wall-length-label {
  display: none;
}

.editor-canvas.connections-hidden #connectionsLayer {
  display: none;
}

.editor-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.connection-line {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0.95;
}

#wallCoreLayer {
  pointer-events: none;
}

#previewLayer {
  pointer-events: none;
}

.editor-cursor {
  position: fixed;
  width: 21.6px;
  height: 21.6px;
  border: 0.9px solid #6a7489;
  border-radius: 5.4px;
  background: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translate(12px, 12px);
  z-index: 60;
  box-shadow: 0 2.7px 9px rgba(24, 36, 59, 0.16);
}

.editor-cursor svg {
  width: 12.6px;
  height: 12.6px;
  stroke: #5f6b82;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.element-tooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 80;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(19, 26, 42, 0.92);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(8, 14, 26, 0.22);
  white-space: nowrap;
  transform: translate(12px, -14px);
}

.snap-dot {
  fill: #1f61e8;
  stroke: #ffffff;
  stroke-width: 1.8;
}

.toolbar {
  min-height: 108px;
  border: 0.9px solid #e4e9f2;
  border-radius: 21.6px;
  background: #ffffff;
  box-shadow: 0 7.2px 18px rgba(27, 40, 66, 0.06);
  display: flex;
  align-items: center;
  gap: 10.8px;
  padding: 10.8px 12.6px;
  position: relative;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 1.8px;
  height: 100%;
}

.toolbar-divider {
  width: 0.9px;
  height: 61.2px;
  background: #e3e8f1;
  flex: 0 0 auto;
}

.toolbar-btn {
  min-height: 82.8px;
  min-width: 73.8px;
  padding: 7.2px 9px;
  border-radius: 12.6px;
  border: 0;
  background: transparent;
  color: #1b2940;
  font-size: 12.6px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7.2px;
  text-align: center;
  line-height: 1.15;
}

.toolbar-btn:hover {
  background: #f5f8fe;
}

.toolbar-btn.active {
  background: #eaf1ff;
  color: #1f61e8;
}

.toolbar-btn.main-board-hint {
  position: relative;
  animation: mainBoardHintPulse 1.6s ease-in-out infinite;
}

.toolbar-btn.main-board-hint::after {
  content: "dodaj rozdzielnicę główną";
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 210px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #0f1d36;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 10px 24px rgba(15, 29, 54, 0.2);
  pointer-events: none;
  z-index: 260;
}

.dropdown-item.board-hint-target {
  animation: mainBoardHintPulse 1.6s ease-in-out infinite;
}

@keyframes mainBoardHintPulse {
  0% {
    background-color: transparent;
    box-shadow: 0 0 0 rgba(31, 97, 232, 0);
  }
  50% {
    background-color: #eaf1ff;
    box-shadow: 0 0 0 3px rgba(31, 97, 232, 0.14);
  }
  100% {
    background-color: transparent;
    box-shadow: 0 0 0 rgba(31, 97, 232, 0);
  }
}

.toolbar-btn svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.toolbar-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 3.6px;
}

.toolbar-btn-label svg {
  width: 10.8px;
  height: 10.8px;
  stroke: currentColor;
}

.icon-room {
  stroke: #5f6b82;
}

.icon-wall {
  stroke: #6c778d;
}

.icon-door {
  stroke: #33415c;
}

.icon-window {
  stroke: #4b5d7b;
}

.icon-power {
  stroke: #2fa84f;
}

.icon-light {
  stroke: #e0b000;
}

.icon-control {
  stroke: #ff8a26;
}

.icon-network {
  stroke: #1ea3d8;
}

.icon-security {
  stroke: #e84a5f;
}

.icon-tech {
  stroke: #6f49ff;
}

.toolbar-dropdown-panel {
  position: absolute;
  top: calc(100% + 9px);
  left: 262.8px;
  width: max-content;
  max-width: calc(100% - 273.6px);
  background: #ffffff;
  border: 0.9px solid #dfe6f2;
  border-radius: 16.2px;
  box-shadow: 0 12.6px 28.8px rgba(17, 25, 39, 0.14);
  padding: 12.6px;
  display: none;
  z-index: 40;
}

.toolbar-dropdown-panel.mobile-overlay {
  position: fixed;
  left: auto;
  right: auto;
  transform: none !important;
  top: 76px;
  width: max-content !important;
  max-width: calc(100vw - 24px);
  max-height: min(68vh, 520px);
  overflow: auto;
  z-index: 210;
}

.size-dropdown-panel {
  position: absolute;
  top: calc(100% + 9px);
  background: #ffffff;
  border: 0.9px solid #dfe6f2;
  border-radius: 16.2px;
  box-shadow: 0 12.6px 28.8px rgba(17, 25, 39, 0.14);
  padding: 12px;
  width: 250px;
  display: none;
  z-index: 45;
}

.size-dropdown-panel.open {
  display: block;
}

.size-field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #2f3b52;
}

.size-field-input {
  width: 100%;
  height: 36px;
  border: 0.9px solid #d6ddea;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  color: #1b2940;
  background: #ffffff;
}

.door-hand-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.door-hand-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #2f3b52;
  cursor: pointer;
  user-select: none;
}

.door-hand-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid #8fa0b8;
  background: #ffffff;
  position: relative;
  flex: 0 0 auto;
}

.door-hand-option.active .door-hand-dot::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1f61e8;
}

.toolbar-dropdown-panel.open {
  display: block;
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--tile-width, max-content));
  gap: 9px;
  justify-content: start;
}

.dropdown-item {
  min-height: 88.2px;
  min-width: 88.2px;
  border: 0;
  border-radius: 12.6px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7.2px;
  padding: 7.2px;
  cursor: pointer;
  text-align: center;
  color: #1b2940;
  font-size: 11.7px;
  line-height: 1.2;
  width: var(--tile-width, max-content);
}

.dropdown-item:hover {
  background: #f5f8fe;
}

.dropdown-item-icon {
  width: 30.6px;
  height: 30.6px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #ffffff;
  border: 0.9px solid currentColor;
  color: #1b2940;
}

.dropdown-item-icon svg {
  width: 19.8px;
  height: 19.8px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropdown-item span:last-child {
  white-space: nowrap;
}

.icon-bg-power {
  color: #2fa84f;
}

.icon-bg-light {
  color: #e0b000;
}

.icon-bg-control {
  color: #ff8a26;
}

.icon-bg-network {
  color: #1ea3d8;
}

.icon-bg-security {
  color: #e84a5f;
}

.icon-bg-tech {
  color: #6f49ff;
}

.left-panel {
  width: 252px;
  --sidebar-font-size: 16.2px;
}

.panel-card {
  background: #ffffff;
  border: 0.9px solid #e4e9f2;
  border-radius: 21.6px;
  padding: 16.2px;
  box-shadow: 0 7.2px 18px rgba(27, 40, 66, 0.06);
  font-size: var(--sidebar-font-size);
}

.panel-card+.panel-card {
  margin-top: 12.6px;
}

.card-label {
  display: block;
  margin-bottom: 9px;
  font-size: var(--sidebar-font-size);
  font-weight: 700;
  color: #1b2940;
}

.floor-select {
  position: relative;
}

.floor-select-trigger {
  width: 100%;
  height: 50.4px;
  border-radius: 25.2px;
  border: 0.9px solid #d4dce9;
  background: #ffffff;
  padding: 0 16.2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--sidebar-font-size);
  font-weight: 400;
  color: #15233d;
  cursor: pointer;
}

.floor-select-trigger svg {
  width: 16.2px;
  height: 16.2px;
  stroke: #33445f;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.floor-dropdown {
  position: absolute;
  top: calc(100% + 7.2px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 0.9px solid #d9e1ee;
  border-radius: 18px;
  padding: 9px;
  box-shadow: 0 12.6px 28.8px rgba(16, 27, 46, 0.14);
  display: none;
  z-index: 20;
}

.floor-dropdown.open {
  display: block;
}

.floor-option {
  width: 100%;
  height: 39.6px;
  border-radius: 12.6px;
  border: 0.9px solid #d7dfeb;
  background: #ffffff;
  color: #101b30;
  font-size: var(--sidebar-font-size);
  font-weight: 400;
  text-align: left;
  padding: 0 12.6px;
  cursor: pointer;
  margin-bottom: 7.2px;
}

.floor-option:last-child {
  margin-bottom: 0;
}

.floor-add {
  border-color: #a9c2ef;
  background: #eaf2ff;
  color: #101b30;
  font-weight: 400;
}

.floor-option:hover {
  background: #edf4ff;
  border-color: #b8cbef;
  box-shadow: 0 2px 8px rgba(31, 97, 232, 0.14);
}

.floor-option.active {
  border-color: #1f61e8;
  box-shadow: inset 0 0 0 0.9px #1f61e8;
}

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 1.8px;
}

.tool-item {
  width: 100%;
  height: 39.6px;
  border: 0;
  background: transparent;
  border-radius: 10.8px;
  display: flex;
  align-items: center;
  gap: 10.8px;
  padding: 0 9px;
  font-size: var(--sidebar-font-size);
  font-weight: 400;
  color: #1a2740;
  cursor: pointer;
  text-align: left;
}

.tool-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.tool-item.active {
  background: #eaf1ff;
  color: #1f61e8;
}

.tool-item:hover {
  background: #edf4ff;
  color: #1f61e8;
  box-shadow: 0 2px 8px rgba(31, 97, 232, 0.14);
}

.view-tools-row {
  display: flex;
  gap: 9px;
  margin-bottom: 10.8px;
}

.icon-pill {
  width: 36px;
  height: 36px;
  border: 0.9px solid #d6deeb;
  border-radius: 899.1px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #24324c;
}

.icon-pill svg {
  width: 16.2px;
  height: 16.2px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoom-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 12.6px;
}

.zoom-slider {
  width: 100%;
  accent-color: #1f61e8;
  cursor: pointer;
}

.zoom-value {
  font-size: var(--sidebar-font-size);
  font-weight: 400;
  color: #1a2740;
  min-width: 39.6px;
  text-align: right;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10.8px;
  font-size: var(--sidebar-font-size);
  font-weight: 400;
  color: #1a2740;
}

.pricing-summary {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: var(--sidebar-font-size);
  color: #1a2740;
}

.pricing-row,
.pricing-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pricing-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 3px 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  border-radius: 8px;
}

.pricing-toggle:hover {
  color: #1f61e8;
}

.pricing-toggle-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pricing-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s ease;
}

.pricing-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.pricing-row strong,
.pricing-group-row strong {
  font-weight: 700;
  color: #0f1d36;
  white-space: nowrap;
}

.pricing-details {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
  padding: 7px 0 4px 10px;
  border-left: 2px solid #e1e7f1;
}

.pricing-details.open {
  display: flex;
}

.pricing-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: calc(var(--sidebar-font-size) * 0.9);
  color: #31405d;
}

.pricing-detail-row strong {
  font-weight: 700;
  color: #0f1d36;
  white-space: nowrap;
}

.pricing-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 7px;
  border-top: 0.9px solid #e1e7f1;
}

.pricing-groups .pricing-details {
  margin-top: -3px;
  margin-bottom: 3px;
}

.switch {
  position: relative;
  width: 34.2px;
  height: 21.6px;
  border-radius: 899.1px;
  border: 0.9px solid #cfd8e7;
  background: #e8edf6;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
  flex: 0 0 auto;
}

.switch::after {
  content: "";
  position: absolute;
  top: 1.8px;
  left: 1.8px;
  width: 16.2px;
  height: 16.2px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0.9px 3.6px rgba(16, 24, 40, 0.22);
  transition: transform .2s ease;
}

.switch.on {
  background: #1f61e8;
  border-color: #1f61e8;
}

.switch.on::after {
  transform: translateX(12.6px);
}

@media (max-width: 1360px) {
  .topbar-title {
    font-size: 24px;
  }

  .workspace-top,
  .workspace-main {
    grid-template-columns: 220px 1fr;
  }

  .left-panel {
    width: 220px;
  }

  .toolbar {
    overflow-x: auto;
    overflow-y: visible;
  }
}

@media (max-width: 1080px) {
  .topbar {
    height: auto;
    min-height: 77.4px;
    padding: 10px 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-brand {
    height: auto;
    min-height: 52px;
  }

  .topbar-logo-link {
    height: 52px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

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

  .app-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .workspace-top,
  .workspace-main,
  .workspace-top > .left-panel,
  .workspace-main > .left-panel {
    display: contents;
  }

  .workspace-main > .left-panel > .panel-card:first-child {
    order: 1;
  }

  .workspace-main > .left-panel > .tools-panel-card {
    display: none;
  }

  .workspace-top > .left-panel > .panel-card {
    order: 2;
  }

  .workspace-top > .toolbar {
    order: 3;
  }

  .workspace-main > .editor-shell {
    order: 4;
  }

  .editor-tools-floating {
    display: inline-flex;
  }

  .workspace-main > .left-panel > .view-settings-card {
    order: 5;
  }

  .workspace-main > .left-panel > .pricing-card {
    order: 6;
  }

  .app-layout > * {
    width: 100%;
  }

  .panel-card {
    border-radius: 16px;
  }

  .editor-shell {
    min-height: clamp(460px, 62vh, 680px);
  }

  .editor-canvas {
    min-height: clamp(430px, 58vh, 640px);
  }
}

@media (max-width: 760px) {
  .app-layout {
    padding: 10px;
  }

  .topbar-title {
    font-size: 20px;
    line-height: 1.1;
  }

  .topbar-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .toolbar {
    padding: 8px 10px;
    border-radius: 16px;
  }

  .toolbar-btn {
    min-width: 66px;
    min-height: 74px;
    font-size: 11px;
  }

  .toolbar-btn svg {
    width: 23px;
    height: 23px;
  }

  .editor-shell {
    padding: 10px;
    border-radius: 16px;
  }

  .editor-canvas {
    border-radius: 12px;
    min-height: 52vh;
  }

  .toolbar-dropdown-panel.mobile-overlay {
    top: 64px;
    max-height: 72vh;
    padding: 10px;
  }
}
