/* Compact, consistent help on the single-service editor. The text remains in
 * place for assistive technology and scripts that update it after a change. */
body.post-type-creavibc_service .creavibc-tooltip-source,
body.post-type-creavibc_service .inside .creavibc-tooltip-source {
  display: none !important;
}

body.post-type-creavibc_service .creavibc-setting-help {
  display: inline-flex;
  position: relative;
  align-items: center;
  vertical-align: middle;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

/* Keep these rules stronger than the older metabox label/heading styles.
 * Inline-block headings ignore gap, and label margins offset the help icon. */
body.post-type-creavibc_service #poststuff .postbox .creavibc-setting-label-row,
body.post-type-creavibc_service #poststuff .postbox .creavibc-setting-help-anchor,
body.post-type-creavibc_service #poststuff .postbox legend:has(> .creavibc-setting-help) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px;
  box-sizing: border-box;
  max-width: 100%;
  vertical-align: middle;
}

body.post-type-creavibc_service .creavibc-setting-label-row {
  align-self: flex-start;
  width: max-content;
  min-height: 24px;
  margin: 0;
}

body.post-type-creavibc_service #poststuff .postbox .creavibc-setting-label-row > label {
  display: inline-block !important;
  flex: 0 1 auto;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
  white-space: normal !important;
  vertical-align: middle;
}

body.post-type-creavibc_service #poststuff .postbox .creavibc-setting-label-row > label strong {
  margin: 0 !important;
  vertical-align: middle;
}

body.post-type-creavibc_service .creavibc-setting-label-row > .creavibc-setting-help,
body.post-type-creavibc_service .creavibc-setting-help-anchor > .creavibc-setting-help {
  flex: none;
  margin: 0;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-field > .creavibc-setting-label-row {
  display: flex !important;
  margin-bottom: 3px;
}

body.post-type-creavibc_service .creavibc-setting-label-row > label,
body.post-type-creavibc_service .creavibc-setting-help-anchor {
  color: var(--cbs-admin-label, #374151) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  line-height: 1.4 !important;
}

body.post-type-creavibc_service .creavibc-setting-help-anchor > strong,
body.post-type-creavibc_service .creavibc-setting-label-row strong {
  margin: 0 !important;
}

/* WordPress and older metabox rules give every radio label large margins.
 * Choice cards already have their own grid gap, so use that spacing alone. */
body.post-type-creavibc_service .inside .creavibc-ap-layout-options > .creavibc-ap-layout-option,
body.post-type-creavibc_service .inside .creavibc-lm-cards > .creavibc-lm-card {
  align-items: center;
  gap: 10px;
  margin: 0 !important;
}

body.post-type-creavibc_service .creavibc-ap-layout-option > input[type="radio"] {
  margin: 0 !important;
}

body.post-type-creavibc_service :is(.creavibc-ap-field, .creavibc-lm-field, #creavibc_available_days .creavibc-field) {
  min-width: 0;
  gap: 6px;
}

body.post-type-creavibc_service .creavibc-ap-field--color:has(.creavibc-setting-label-row) {
  min-width: 120px;
  max-width: 160px;
}

body.post-type-creavibc_service #creavibc_service_appearance .creavibc-ap-label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

body.post-type-creavibc_service #creavibc_service_appearance .creavibc-ap-label-name {
  min-width: 0;
  margin: 0;
  white-space: normal;
}

body.post-type-creavibc_service #creavibc_service_appearance .creavibc-ap-label-row > .cbs-editable {
  display: flex;
  align-items: center;
  min-width: 0;
}

body.post-type-creavibc_service #creavibc_service_appearance .cbs-editable-text {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #dce0ec;
  background: #fff;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.post-type-creavibc_service #creavibc_service_appearance .cbs-editable-pencil {
  flex: none;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-field > .creavibc-setting-label-row {
  margin-bottom: 0;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-ap-section--days-notice .creavibc-ap-field--wider {
  flex: 0 1 180px;
  min-width: 140px;
  max-width: 180px;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-ap-field--unit-select {
  flex: 0 1 140px;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-ap-field--unit-select > label {
  min-height: 24px;
  margin: 0 !important;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-ap-num-wrap {
  box-sizing: border-box;
  height: 40px;
}

body.post-type-creavibc_service #creavibc_available_days .creavibc-ap-num-wrap input[type="number"] {
  box-sizing: border-box;
  width: 100% !important;
  height: 100%;
  min-height: 0 !important;
  margin: 0;
}

body.post-type-creavibc_service #creavibc_available_days :is(.creavibc-field input[type="text"], .creavibc-field select, .creavibc-window-row input[type="number"], .creavibc-ap-field--unit-select select) {
  min-height: 40px !important;
  height: 40px;
  margin: 0 !important;
  box-sizing: border-box;
}

body.post-type-creavibc_service #creavibc_service_notifications :is(.inside > p, .cbs-reminder-group > p) {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 0 0 18px !important;
}

body.post-type-creavibc_service #creavibc_service_notifications :is(.inside > p, .cbs-reminder-group > p) > br {
  display: none;
}

body.post-type-creavibc_service #creavibc_service_notifications .creavibc-email-body-field > .creavibc-setting-label-row {
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  body.post-type-creavibc_service .creavibc-setting-label-row {
    width: auto;
  }

  body.post-type-creavibc_service #creavibc_available_days .creavibc-ap-section--days-notice .creavibc-ap-row {
    flex-wrap: nowrap;
    gap: 12px;
  }

  body.post-type-creavibc_service #creavibc_available_days .creavibc-tabs-head {
    flex-direction: column;
    align-items: stretch !important;
  }

  body.post-type-creavibc_service #creavibc_available_days .creavibc-tab-nav {
    display: flex;
  }

  body.post-type-creavibc_service #creavibc_available_days .creavibc-tab {
    flex: 1;
    min-width: 0;
    white-space: normal;
  }

  body.post-type-creavibc_service .creavibc-display-intro {
    position: relative;
  }

  body.post-type-creavibc_service .creavibc-display-shortcode-help {
    position: static;
  }

  body.post-type-creavibc_service .creavibc-display-shortcode-tooltip {
    left: 0;
    box-sizing: border-box;
    width: 100%;
    transform: translateY(4px);
  }

  body.post-type-creavibc_service .creavibc-display-shortcode-tooltip::after {
    left: calc(100% - 12px);
  }

  body.post-type-creavibc_service .creavibc-display-shortcode-help:is(:hover, :focus-within) .creavibc-display-shortcode-tooltip {
    transform: translateY(0);
  }
}

body.post-type-creavibc_service .creavibc-setting-help-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 21px;
  height: 21px;
  min-height: 21px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid #c9c7ee;
  border-radius: 50%;
  background: #f3f2ff;
  color: #4a46a5;
  box-shadow: none;
  font: 700 12px/1 system-ui, sans-serif;
  cursor: help;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

body.post-type-creavibc_service .creavibc-setting-help-button:hover,
body.post-type-creavibc_service .creavibc-setting-help-button:focus-visible {
  border-color: #4a46e5;
  background: #e9e8ff;
  color: #25217d;
  outline: 2px solid #8a86ee;
  outline-offset: 2px;
}

body.post-type-creavibc_service #creavibc_output_type .creavibc-time-format-heading > strong.creavibc-setting-help-anchor,
body.post-type-creavibc_service #creavibc_output_type .creavibc-checkbox-label strong.creavibc-setting-help-anchor,
body.post-type-creavibc_service #creavibc_output_type .creavibc-inline-display-note > strong.creavibc-setting-help-anchor {
  display: inline-flex !important;
  align-items: center;
  width: max-content;
  max-width: 100%;
  line-height: 1.35 !important;
}

body.post-type-creavibc_service #creavibc_service_appearance .creavibc-ap-layout-option > span {
  display: block !important;
}

body.post-type-creavibc_service .creavibc-setting-tooltip {
  display: none;
  position: fixed;
  z-index: 100000;
  box-sizing: border-box;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 13px 15px;
  border: 1px solid #dddaf5;
  border-radius: 12px;
  background: #fff;
  color: #344054;
  box-shadow: 0 14px 36px rgba(36, 33, 92, .17), 0 2px 8px rgba(36, 33, 92, .06);
  font: 400 12px/1.55 system-ui, sans-serif;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
}

body.post-type-creavibc_service .creavibc-setting-tooltip.is-visible {
  display: block;
}

body.post-type-creavibc_service .creavibc-setting-tooltip code {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  background: #f3f2ff;
  color: #343098;
  font-size: 11px;
}

body.post-type-creavibc_service .creavibc-setting-tooltip .dashicons {
  font-size: 15px;
  width: 15px;
  height: 15px;
  vertical-align: middle;
}
