/* CRM minor tweaks */
.app-main { min-height: 70vh; }
.small-box { padding: 1rem; border-radius: 0.5rem; }
.small-box h3 { margin: 0; }
.small-box p { margin: 0.25rem 0 0; opacity: 0.9; }

/* Address same-as checkboxes: hide fields that will be auto-filled */
.address-group:has([data-same-as-mailing]:checked) [data-billing-fields],
.address-group:has([data-same-as-company]:checked) [data-mailing-fields],
.address-group:has([data-same-as-company]:checked) [data-billing-fields],
.address-group:has([data-same-as-company]:checked) [data-same-as-mailing-wrap],
.address-group [data-mailing-fields].d-none,
.address-group [data-billing-fields].d-none,
.address-group [data-same-as-mailing-wrap].d-none {
  display: none !important;
}

/* Agreement editor shell */
.agreement-editor {
  border-radius: 0.375rem;
  overflow: hidden;
  min-height: 28rem;
}
.agreement-editor .toastui-editor-defaultUI {
  border-radius: 0.375rem;
}
.agreement-editor .toastui-editor-main {
  min-height: 22rem;
}

/*
  Portal dark theme + Toast UI can leave typed characters the same color as the
  background. The "gray bar" users see is the browser selection highlight over
  that invisible text. Force light foreground (and caret) on every editing surface.
*/
.agreement-editor .toastui-editor-dark,
.agreement-editor .toastui-editor-defaultUI,
.agreement-editor .toastui-editor-md-container,
.agreement-editor .toastui-editor-ww-container,
.agreement-editor .toastui-editor-main,
.agreement-editor .ProseMirror,
.agreement-editor .toastui-editor-contents,
.agreement-editor .toastui-editor-contents *,
.agreement-editor [contenteditable="true"],
.agreement-editor [contenteditable="true"] * {
  color: #eee !important;
  caret-color: #eee !important;
}
.agreement-editor .ProseMirror,
.agreement-editor [contenteditable="true"] {
  background-color: transparent !important;
}
.agreement-editor .ProseMirror ::selection,
.agreement-editor [contenteditable="true"] ::selection {
  background: rgba(103, 204, 255, 0.45) !important;
  color: #fff !important;
}

#agreement-editor-status:empty,
#agreement-editor-status.d-none,
#renewal-editor-status:empty,
#renewal-editor-status.d-none,
#expiration-editor-status:empty,
#expiration-editor-status.d-none {
  display: none;
}

/* Insert-variable toolbar control — match Toast UI icon button box */
.agreement-var-menu {
  position: relative;
  display: flex;
  align-items: center;
  align-self: center;
  height: 32px;
  margin: 7px 5px;
}
.agreement-var-btn {
  color: #eee !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  height: 32px !important;
  margin: 0 !important;
  background-image: none !important;
}
.agreement-var-dropdown {
  position: absolute;
  z-index: 2000;
  min-width: 14rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.25rem;
  border: 1px solid #494c56;
  border-radius: 0.375rem;
  background: #232428;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);
}
.agreement-var-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #eee;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}
.agreement-var-option:hover,
.agreement-var-option:focus {
  background: #36383f;
  color: #fff;
  outline: none;
}
