/* V21 staging controls are a fixed overlay; opening them never resizes checkout. */
[data-design-element][hidden],
[data-design-group][hidden] {
  display: none !important;
}

.design-controls,
.design-controls * {
  box-sizing: border-box;
}

.design-controls {
  position: fixed;
  z-index: 80;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: flex-end;
  width: min(344px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  pointer-events: none;
  color: #1e1e1b;
  font-family: Geist, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
}

.design-controls button,
.design-controls input {
  font: inherit;
}

.design-controls button {
  cursor: pointer;
}

.design-controls-opener {
  pointer-events: auto;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid #68684f;
  border-radius: 10px;
  background: #24251d;
  color: #fffdf5;
  box-shadow: 0 3px 14px #0002;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.design-controls-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  pointer-events: auto;
  max-height: calc(100vh - 100px);
  max-height: min(660px, calc(100dvh - 100px));
  overflow: hidden;
  border: 1px solid #c6c3b7;
  border-radius: 12px;
  background: #faf9f3;
  color: #1e1e1b;
  box-shadow: 0 10px 36px #0003;
}

.design-controls-panel[hidden] {
  display: none !important;
}

.design-controls-header,
.design-controls-footer {
  flex: none;
  padding: 12px 14px;
  background: #faf9f3;
}

.design-controls-header {
  border-bottom: 1px solid #e1ded3;
}

.design-controls-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.design-controls-title {
  margin: 0;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.design-controls-close {
  flex: none;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #d0cdc0;
  border-radius: 6px;
  background: #fffef9;
  color: inherit;
  font-weight: 600 !important;
}

.design-controls-description {
  margin: 5px 0 0;
  color: #615f56;
  font-size: 13px;
  line-height: 1.4;
}

.design-controls-fields {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 14px 10px;
  scrollbar-gutter: stable;
}

.design-controls-group {
  min-width: 0;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
}

.design-controls-legend {
  width: 100%;
  margin: 0 0 4px;
  padding: 0 0 5px;
  border-bottom: 1px solid #e1ded3;
  color: #454536;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.design-controls-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0;
  padding: 6px 2px;
  color: inherit;
  cursor: pointer;
}

.design-controls-checkbox {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #626447;
  cursor: pointer;
}

.design-controls-option-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

.design-controls-footer {
  border-top: 1px solid #e1ded3;
}

.design-controls-status {
  margin: 0 0 8px;
  color: #615f56;
  font-size: 13px;
  line-height: 1.4;
}

.design-controls-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.design-controls-action {
  flex: 1 1 auto;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #cfccbd;
  border-radius: 6px;
  background: #f1efe5;
  color: #292a22;
  font-weight: 600 !important;
}

.design-controls :focus-visible {
  outline: 2px solid #7c813e;
  outline-offset: 3px;
}

@media (max-height: 380px) {
  .design-controls-header,
  .design-controls-footer {
    padding: 8px 12px;
  }

  .design-controls-description,
  .design-controls-status {
    display: none;
  }
}
