.design-helper {
  position: fixed;
  top: calc(var(--navbar-offset) + 58px);
  right: 12px;
  left: auto;
  z-index: 120000;
}

@media (max-width: 750px) {
  .design-helper {
    display: none;
  }
}

.design-helper-toggle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  margin-top: 10px;
  background: var(--bg-dark) !important;
  border: 3px solid var(--accent-blue);
  cursor: pointer;
  color: #ffffff;
  font-size: 1.4rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  box-shadow:
    0 4px 16px rgba(99, 102, 241, 0.4),
    0 0 0 1px rgba(99, 102, 241, 0.1);
}

.design-helper-toggle-button:hover {
  background: var(--primary-blue-hover);
  border-color: var(--accent-blue);
  color: #ffffff;
  transform: scale(1.1);
  box-shadow:
    0 6px 24px rgba(99, 102, 241, 0.5),
    0 0 0 2px rgba(99, 102, 241, 0.2);
}

.design-helper-toggle-button:active {
  transform: scale(0.95);
}

.design-helper-toggle-button:focus {
  outline: none;
  box-shadow:
    0 4px 16px rgba(99, 102, 241, 0.4),
    0 0 0 1px rgba(99, 102, 241, 0.1);
}

.design-helper-toggle-button i {
  display: inline-block;
  line-height: 1;
}

.design-helper-window {
  position: fixed;
  top: calc(var(--navbar-offset) + 112px);
  right: 12px;
  left: auto;
  z-index: 120001;
  width: 330px;
  max-width: calc(100vw - 24px);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  color: #f8fafc;
  overflow: visible;
  display: none;
  user-select: none;
}

body.theme-light .design-helper-window {
  background: rgba(241, 245, 249, 0.74);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.65);
}

.design-helper-window.is-open {
  display: block;
}

.design-helper-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: move;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

body.theme-light .design-helper-window-header {
  background: rgba(226, 232, 240, 0.82);
}

.design-helper-window-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.design-helper-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.42);
  color: inherit;
  cursor: pointer;
}

body.theme-light .design-helper-close {
  background: rgba(255, 255, 255, 0.7);
}

.design-helper-window-body {
  position: relative;
  z-index: 1;
  padding: 12px;
}

.design-helper-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.design-helper-field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.design-helper-field select {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.55);
  color: #f8fafc;
  font-size: 13px;
}

body.theme-light .design-helper-field select {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
}

/* Ensure dropdown component panel is above the helper window when open */
body:has(#design-helper-window.is-open) .custom-dropdown-panel.is-open {
  z-index: 130010 !important;
}
