.cpe-host { margin-top: 10px; }
.cpe-editor {
  border: 1px solid #e5eaf1;
  border-radius: 10px;
  background: #fafbfc;
  overflow: hidden;
}
.cpe-editor[open] { background: #fff; }
.cpe-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.cpe-summary::-webkit-details-marker { display: none; }
.cpe-summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
}
.cpe-editor[open] > .cpe-summary::before { transform: rotate(45deg); }
.cpe-title { font-size: 13px; font-weight: 600; color: #334155; }
.cpe-status {
  margin-left: auto;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 1px 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
}
.cpe-status.is-custom { color: #8a6d1a; border-color: #e6d79c; background: #fffbeb; }
.cpe-body { padding: 0 12px 12px; }
.cpe-action-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cpe-action-row .cpe-hint { flex: 1; }
.cpe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.cpe-field { min-width: 0; }
.cpe-label { display: block; margin: 0 0 5px; color: #475569; font-size: 12px; font-weight: 500; }
.cpe-control { min-width: 0; }
.cpe-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 12px;
}
.cpe-input:focus { outline: none; border-color: #c9a84c; box-shadow: 0 0 0 2px rgba(201,168,76,.10); }
.cpe-input[aria-invalid="true"] { border-color: #ef4444; }
.cpe-input:disabled { color: #94a3b8; background: #f1f5f9; cursor: not-allowed; }
.cpe-token-row { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 6px; }
.cpe-token-row.cpe-token-single { grid-template-columns: minmax(0, 1fr); }
.cpe-hint { margin: 4px 0 0; color: #94a3b8; font-size: 11px; line-height: 1.5; }
.cpe-error { min-height: 0; margin: 3px 0 0; color: #dc2626; font-size: 11px; line-height: 1.45; }
.cpe-error:empty { display: none; }
.cpe-link-button, .cpe-secondary-button, .cpe-add-button, .cpe-icon-button {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}
.cpe-link-button { flex: none; padding: 0; color: #9a7a20; font-size: 11px; white-space: nowrap; }
.cpe-link-button:hover { text-decoration: underline; }
.cpe-secondary-button, .cpe-add-button {
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  padding: 5px 10px;
  color: #475569;
  background: #fff;
  font-size: 11px;
}
.cpe-secondary-button:hover, .cpe-add-button:hover { background: #f8fafc; border-color: #cbd5e1; }
.cpe-secondary-button:disabled { opacity: .45; cursor: default; }
.cpe-advanced { margin-top: 12px; border-top: 1px dashed #e5eaf1; padding-top: 9px; }
.cpe-advanced > summary { width: fit-content; cursor: pointer; color: #64748b; font-size: 12px; }
.cpe-advanced-body { padding-top: 8px; }
.cpe-custom-group { margin-top: 10px; padding: 10px; border: 1px solid #edf0f4; border-radius: 8px; background: #fafbfc; }
.cpe-custom-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.cpe-custom-head strong { color: #475569; font-size: 12px; font-weight: 600; }
.cpe-custom-head .cpe-hint { margin: 0; }
.cpe-custom-list { display: flex; flex-direction: column; gap: 7px; }
.cpe-custom-list:empty { display: none; }
.cpe-custom-controls { display: grid; grid-template-columns: minmax(100px, 1fr) 76px minmax(140px, 1.5fr) 26px; gap: 6px; align-items: center; }
.cpe-custom-key-error, .cpe-custom-value-error { grid-column: 1 / -1; }
.cpe-icon-button { width: 26px; height: 26px; border-radius: 5px; padding: 0; color: #94a3b8; font-size: 18px; line-height: 1; }
.cpe-icon-button:hover { color: #dc2626; background: #fef2f2; }
.cpe-add-button { margin-top: 8px; }
.cpe-notice { margin: 0 0 8px; color: #a16207; font-size: 12px; line-height: 1.6; }
.cpe-raw-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  resize: vertical;
  border: 1px solid #dbe2ea;
  border-radius: 7px;
  padding: 8px 10px;
  color: #334155;
  background: #fff;
  font: 12px/1.5 monospace;
}
.cpe-raw-input + .cpe-error { margin-bottom: 8px; }

@media (max-width: 720px) {
  .cpe-grid { grid-template-columns: 1fr; }
  .cpe-custom-controls { grid-template-columns: minmax(90px, 1fr) 70px minmax(110px, 1.2fr) 26px; }
}
