/* Tiny, focused CSS for the modal + button hover. We keep it minimal for performance. */
.chd-wrapper .chd-open {
  cursor: pointer;
  padding: 10px 14px;
  line-height: 1.2;
  border-radius: 6px;
  transition: background-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.chd-wrapper .chd-open:hover,
.chd-wrapper .chd-open:focus {
  background: var(--chd-btn-hover, #005f8d);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

/* Ensure the modal sits above sticky headers/overlays */
.chd-modal { 
  position: fixed; inset: 0; z-index: 999999;
}
.chd-modal[hidden] { display: none !important; }

.chd-modal .chd-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 1;
}

/* Fullscreen centering layer */
.chd-modal .chd-dialog {
  position: fixed; inset: 0;
  display: flex; 
  flex-direction: column;     /* stack header above body */
  align-items: center; 
  justify-content: center;
  padding: 16px;
  z-index: 2;
  pointer-events: none;       /* only the panel captures clicks */
}

/* Panel sections (capture clicks) */
.chd-modal .chd-dialog .chd-header,
.chd-modal .chd-dialog .chd-body {
  pointer-events: auto;
  margin: 0;
  background: #fff; color: #111;
  padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.chd-modal .chd-dialog .chd-header {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid #eee;
  width: min(90vw, 720px);
}

.chd-modal .chd-dialog .chd-body {
  border-radius: 0 0 10px 10px;
  width: min(90vw, 720px);
}

.chd-modal .chd-dialog .chd-close {
  background: transparent; border: none; font-size: 28px; line-height: 1; cursor: pointer;
}

.chd-modal .chd-dialog .chd-form-target {
  min-width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.chd-warning {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  padding: 10px 12px;
  border-radius: 6px;
  color: #664d03;
  margin-top: 10px;
}
