.pdt-design-wrap {
  --pdt-design-text: #0f172a;
  --pdt-design-muted: #64748b;
  --pdt-design-border: #d9e2ef;
  --pdt-design-surface: #ffffff;
  --pdt-design-soft: #f8fbff;
  --pdt-design-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.pdt-design-form .pdt-settings-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--pdt-design-border);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.pdt-design-wrap .pdt-header {
  margin-bottom: 18px;
}

.pdt-design-form .pdt-settings-section h3 {
  margin: 0 0 10px;
}

.pdt-design-form {
  --pdt-design-label-width: 190px;
}

.pdt-design-form .pdt-form-row {
  display: grid;
  grid-template-columns: var(--pdt-design-label-width) minmax(0, 1fr);
  gap: 14px 16px;
  align-items: start;
  margin: 15px 0;
}

.pdt-design-form .pdt-form-row > .description {
  grid-column: 2;
  margin: -4px 0 0;
  color: var(--pdt-design-muted);
}

.pdt-design-form .pdt-form-row--textarea {
  align-items: start;
}

.pdt-design-form .pdt-form-row select,
.pdt-design-form .pdt-form-row input[type="number"] {
  min-width: 280px;
  max-width: 420px;
}

.pdt-design-form .pdt-form-row--inline-actions {
  grid-template-columns: var(--pdt-design-label-width) minmax(0, 1fr);
  align-items: center;
}

.pdt-design-inline-control {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.pdt-design-inline-control .button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdt-design-field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.pdt-design-field-label--top {
  align-items: center;
}

.pdt-design-form label {
  display: block;
  font-weight: 600;
  margin: 0;
}

.pdt-design-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.pdt-design-color-row .pdt-design-field-label {
  width: 240px;
  flex: 0 0 240px;
}

.pdt-design-color-row input[type="color"] {
  flex: 0 0 auto;
}

.pdt-design-color-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.pdt-design-color-pair__item .pdt-design-color-row {
  margin: 12px 0 0;
}

.pdt-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pdt-help-tooltip__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #c3c4c7;
  border-radius: 999px;
  background: #fff;
  color: #50575e;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.pdt-help-tooltip__toggle:hover,
.pdt-help-tooltip__toggle:focus {
  border-color: #2271b1;
  color: #2271b1;
  outline: none;
}

.pdt-help-tooltip__content {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 20;
  width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1d2327;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.pdt-help-tooltip__content::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #1d2327 transparent;
}

.pdt-help-tooltip:hover .pdt-help-tooltip__content,
.pdt-help-tooltip:focus-within .pdt-help-tooltip__content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.pdt-design-screen-grid-wrap {
  display: none;
  margin: 16px 0 8px;
  padding: 18px;
  border: 1px dashed var(--pdt-design-border);
  border-radius: 16px;
  background: var(--pdt-design-soft);
}

.pdt-design-screen-grid-wrap.is-visible {
  display: block;
}

.pdt-design-screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.pdt-design-screen-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #d6dfeb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pdt-design-screen-chip:hover {
  transform: translateY(-1px);
  border-color: #b7c7e5;
}

.pdt-design-screen-chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pdt-design-screen-chip span {
  color: var(--pdt-design-text);
  font-size: 13px;
  font-weight: 600;
}

.pdt-design-screen-chip input:checked + span {
  color: #1743c9;
}

.pdt-design-screen-chip:has(input:checked) {
  border-color: #7aa2ff;
  background: #eef4ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.pdt-design-screen-chip.is-checked {
  border-color: #7aa2ff;
  background: #eef4ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.pdt-design-code {
  width: 100%;
  min-height: 220px;
  padding: 14px 16px;
  border: 1px solid var(--pdt-design-border);
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.pdt-design-code:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #93c5fd, 0 0 0 4px rgba(147, 197, 253, 0.2);
  outline: none;
}

.pdt-design-playground {
  --pg-primary: #4f46e5;
  --pg-bg: #f8fafc;
  --pg-surface: #ffffff;
  --pg-text: #0f172a;
  --pg-muted: #64748b;
  --pg-sidebar: #0f172a;
  --pg-adminbar: #0f172a;
  --pg-adminbar-submenu: #1f2937;
  --pg-border: #d9e2ef;
  --pg-hover: #eef4ff;
  --pg-focus: #93c5fd;
  --pg-success: #16a34a;
  --pg-warning: #d97706;
  --pg-error: #dc2626;
  --pg-table-head: #eef2ff;
  --pg-input-bg: #ffffff;
  --pg-radius: 8px;
  --pg-button-radius: 8px;
  --pg-font: Inter, sans-serif;
  --pg-font-scale: 1;
  --pg-space-scale: 1;
  --pg-density-scale: 1;
  --pg-on-primary: #f8fafc;
  --pg-on-surface: #0f172a;
  --pg-on-sidebar: #f8fafc;
  --pg-on-adminbar: #f8fafc;
  --pg-on-adminbar-submenu: #f8fafc;
  --pg-focus-shadow: rgba(147, 197, 253, 0.2);
  --pg-surface-hover: #f3f7ff;
  --pg-sidebar-hover: #1f2c4f;
  --pg-notice-success-bg: #ecfdf3;
  --pg-notice-warning-bg: #fff7ed;
  --pg-notice-error-bg: #fef2f2;
  --pg-notice-success-text: #14532d;
  --pg-notice-warning-text: #7c2d12;
  --pg-notice-error-text: #7f1d1d;
  --pg-link: #4f46e5;
  --pg-link-hover: #4338ca;
  --pg-link-active: #3730a3;
  --pg-link-visited: #7c3aed;
  --pg-table-head-text: #0f172a;
  border: 1px solid var(--pg-border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--pg-bg);
  box-shadow: var(--pdt-design-shadow);
  font-family: var(--pg-font);
  font-size: calc(13px * var(--pg-font-scale));
  color: var(--pg-text);
}

.pdt-design-playground__adminbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 calc(16px * var(--pg-space-scale));
  background: var(--pg-adminbar);
  color: var(--pg-on-adminbar);
}

.pdt-design-playground__adminbar-group {
  display: flex;
  align-items: center;
  gap: calc(12px * var(--pg-space-scale));
}

.pdt-design-playground__adminbar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.pdt-design-playground__adminbar-link {
  color: var(--pg-on-adminbar);
  font-size: 12px;
  line-height: 1;
}

.pdt-design-playground__shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 520px;
}

.pdt-design-playground__sidebar {
  padding: calc(18px * var(--pg-space-scale));
  background: var(--pg-sidebar);
  color: var(--pg-on-sidebar);
}

.pdt-design-playground__sidebar-title {
  margin-bottom: calc(18px * var(--pg-space-scale));
  font-size: calc(17px * var(--pg-font-scale));
  font-weight: 700;
}

.pdt-design-playground__menu-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 calc(12px * var(--pg-space-scale));
  margin-bottom: calc(8px * var(--pg-space-scale));
  border-radius: calc(var(--pg-radius) + 2px);
  background: transparent;
  color: var(--pg-on-sidebar) !important;
  text-decoration: none !important;
  font-weight: 600;
}

.pdt-design-playground__menu-item:hover {
  background: var(--pg-sidebar-hover);
  color: var(--pg-on-sidebar) !important;
}

.pdt-design-playground__menu-item.is-current {
  background: var(--pg-primary);
  color: var(--pg-on-primary) !important;
}

.pdt-design-playground__content {
  padding: calc(20px * var(--pg-space-scale));
  background: var(--pg-bg);
}

.pdt-design-playground__toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: calc(18px * var(--pg-space-scale));
}

.pdt-design-playground__toolbar h4 {
  margin: 0;
  color: var(--pg-text);
  font-size: calc(22px * var(--pg-font-scale));
  line-height: 1.1;
}

.pdt-design-playground__toolbar p {
  margin: 8px 0 0;
  color: var(--pg-muted);
  line-height: 1.6;
}

.pdt-design-playground__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pdt-design-playground .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: calc(36px * var(--pg-space-scale));
  padding: 0 calc(14px * var(--pg-space-scale));
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-button-radius);
  background: var(--pg-surface);
  color: var(--pg-text);
  font-size: inherit;
  font-weight: 600;
}

.pdt-design-playground .button.button-primary {
  background: var(--pg-primary);
  border-color: var(--pg-primary);
  color: var(--pg-on-primary);
}

.pdt-design-playground__notice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: calc(18px * var(--pg-space-scale));
}

.pdt-design-playground__notice {
  min-height: 44px;
  padding: calc(11px * var(--pg-space-scale)) calc(12px * var(--pg-space-scale));
  border-left: 4px solid currentColor;
  border-radius: calc(var(--pg-radius) + 2px);
  font-weight: 600;
}

.pdt-design-playground__notice--success {
  background: var(--pg-notice-success-bg);
  color: var(--pg-notice-success-text);
}

.pdt-design-playground__notice--warning {
  background: var(--pg-notice-warning-bg);
  color: var(--pg-notice-warning-text);
}

.pdt-design-playground__notice--error {
  background: var(--pg-notice-error-bg);
  color: var(--pg-notice-error-text);
}

.pdt-design-playground__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pdt-design-playground__card {
  padding: calc(18px * var(--pg-space-scale));
  border: 1px solid var(--pg-border);
  border-radius: calc(var(--pg-radius) + 6px);
  background: var(--pg-surface);
  color: var(--pg-on-surface);
}

.pdt-design-playground__card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: calc(12px * var(--pg-space-scale));
}

.pdt-design-playground__card-header h5 {
  margin: 0;
  font-size: calc(15px * var(--pg-font-scale));
}

.pdt-design-playground__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--pg-hover);
  color: var(--pg-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdt-design-playground__card p {
  margin: 0 0 calc(14px * var(--pg-space-scale));
  color: var(--pg-muted);
  line-height: 1.65;
}

.pdt-design-playground__table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: calc(var(--pg-radius) + 2px);
}

.pdt-design-playground__table th,
.pdt-design-playground__table td {
  padding: calc(11px * var(--pg-space-scale)) calc(12px * var(--pg-space-scale));
  border: 1px solid var(--pg-border);
  text-align: left;
}

.pdt-design-playground__table th {
  background: var(--pg-table-head);
  color: var(--pg-table-head-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdt-design-playground__table tbody tr:hover {
  background: var(--pg-surface-hover);
}

.pdt-design-playground__field {
  margin-bottom: calc(14px * var(--pg-space-scale));
}

.pdt-design-playground__field label {
  display: block;
  margin-bottom: 6px;
  color: var(--pg-text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pdt-design-playground__field input,
.pdt-design-playground__field select {
  width: 100%;
  min-height: calc(38px * var(--pg-space-scale));
  padding: 0 calc(12px * var(--pg-space-scale));
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  background: var(--pg-input-bg);
  color: var(--pg-text);
  box-shadow: none;
}

.pdt-design-playground__field input:focus,
.pdt-design-playground__field select:focus {
  border-color: var(--pg-focus);
  box-shadow: 0 0 0 1px var(--pg-focus), 0 0 0 4px var(--pg-focus-shadow);
  outline: none;
}

.pdt-design-playground__link-copy {
  margin: 0;
  color: var(--pg-muted);
}

.pdt-design-playground__link {
  color: var(--pg-link);
  text-decoration: var(--pg-link-decoration, none);
  font-weight: var(--pg-link-weight, 600);
}

.pdt-design-playground__link:hover {
  color: var(--pg-link-hover);
  text-decoration: var(--pg-link-decoration-hover, underline);
}

.pdt-design-playground__link:focus {
  color: var(--pg-link-active);
  text-decoration: var(--pg-link-decoration-hover, underline);
  outline: none;
}

@media (max-width: 1100px) {
  .pdt-design-form {
    --pdt-design-label-width: 200px;
  }

  .pdt-design-form .pdt-form-row {
    grid-template-columns: var(--pdt-design-label-width) minmax(0, 1fr);
  }

  .pdt-design-color-row .pdt-design-field-label {
    width: var(--pdt-design-label-width);
    flex-basis: var(--pdt-design-label-width);
  }

  .pdt-design-playground__shell {
    grid-template-columns: 1fr;
  }

  .pdt-design-playground__sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .pdt-design-playground__sidebar-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .pdt-design-color-pair {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pdt-design-playground__notice-row,
  .pdt-design-playground__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 782px) {
  .pdt-design-form .pdt-form-row {
    grid-template-columns: 1fr;
  }

  .pdt-design-form .pdt-form-row--inline-actions {
    grid-template-columns: 1fr;
  }

  .pdt-design-form .pdt-form-row > .description {
    grid-column: auto;
  }

  .pdt-design-color-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .pdt-design-color-row .pdt-design-field-label {
    width: auto;
    flex-basis: auto;
  }

  .pdt-design-form .pdt-form-row select,
  .pdt-design-form .pdt-form-row input[type="number"] {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .pdt-design-inline-control {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .pdt-design-inline-control .button {
    width: 100%;
    justify-content: center;
  }

  .pdt-design-screen-grid {
    grid-template-columns: 1fr;
  }

  .pdt-design-playground__content {
    padding: 16px;
  }

  .pdt-design-playground__toolbar {
    flex-direction: column;
  }

  .pdt-design-playground__actions {
    width: 100%;
  }

  .pdt-design-playground .button {
    flex: 1 1 auto;
  }
}
