/*
 * Ollira command-button shape contract.
 *
 * New UI must use `.ds-btn` or `[data-ds-button]`. Text and icon+text commands
 * share the compact 6px corner. Legacy families remain in this compatibility
 * list until their markup is migrated. Switches and disclosure rows retain
 * their semantic shape; icon-only and segmented commands use the same corner.
 * A clickable row is not automatically a command button: use the disclosure
 * shape for rows that reveal content, and segmented only for mode selection.
 */

/*
 * PRIMARY ACTION LAW
 * The account's chosen accent communicates "do this". This contract loads after
 * module CSS, so legacy page-local black/ink CTAs cannot reintroduce a second
 * primary-action language. Destructive, secondary and ghost variants are not
 * included here and keep their semantic treatments.
 */
:is(button, a, input[type="button"], input[type="submit"], [role="button"]):is(
  .ds-btn--primary,
  .ds-btn--toolbar,
  .btn-primary,
  .btn--primary,
  .marketing-btn--primary,
  .settings-establishment-btn--primary,
  .founder-ctl-btn--primary,
  .se-btn-primary,
  .sm-btn-primary,
  .taxmgr-btn-primary,
  [class*="--primary"],
  .is-primary,
  [data-ds-button-variant="primary"]
) {
  background: var(--ds-color-primary-command-bg) !important;
  border-color: var(--ds-color-primary-command-bg) !important;
  color: #fff !important;
  border-radius: var(--ds-button-radius) !important;
}

:is(button, a, input[type="button"], input[type="submit"], [role="button"]):is(
  .ds-btn--primary,
  .ds-btn--toolbar,
  .btn-primary,
  .btn--primary,
  .marketing-btn--primary,
  .settings-establishment-btn--primary,
  .founder-ctl-btn--primary,
  .se-btn-primary,
  .sm-btn-primary,
  .taxmgr-btn-primary,
  [class*="--primary"],
  .is-primary,
  [data-ds-button-variant="primary"]
):not(:disabled, [aria-disabled="true"], .is-disabled):hover {
  background: var(--ds-color-primary-command-bg-hover) !important;
  border-color: var(--ds-color-primary-command-bg-hover) !important;
}

.ds-btn,
[data-ds-button],
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.qadd-btn,
.ctb-pill,
.ctb-waitlist,
.app-modal__btn,
.settings-establishment-btn,
.marketing-btn,
.founder-ctl-btn,
.dsh-btn,
.sm-btn,
.se-btn,
.rdv2__btn,
.pos-dd-btn,
.cal-v4-appt-create__btn,
.cal-v4-apptc2__btn,
.cal-v4-appt-detail__btn,
.cal-v4-appt-edit__save,
.cal-v4-blocked-time__save,
.cal-v4-drawer__empty-action,
.cal-v4-empty__cta,
.cal-v4-staging-drawer__walkin-addbtn,
.cal-v4-staging-drawer__walkin-save,
.cal-waitlist-drawer__booksubmit,
.cal-waitlist-new-client__ghost,
.cal-waitlist-new-client__save,
.settings-savebar button,
.staff-create-btn-cancel,
.staff-create-btn-submit,
.sales-home-btn,
.sales-home-cta,
.sales-landing-cta,
.sov-cta,
.sc-cta,
.app-toast__action {
  border-radius: var(--ds-button-radius) !important;
}

[data-ds-button-shape="icon"],
.sm-btn-icon,
.cal-v4-appt-create__btn--icon {
  border-radius: var(--ds-button-radius-icon) !important;
}

[data-ds-button-shape="segmented"] {
  border-radius: var(--ds-button-radius-segmented) !important;
}

[data-ds-button-shape="disclosure"] {
  border-radius: var(--ds-disclosure-radius) !important;
}

[data-ds-button-shape="field"] {
  border-radius: var(--ds-field-control-radius) !important;
}

[data-ds-button-shape="option"] {
  border-radius: var(--ds-option-radius) !important;
}

/* Full-width actions inside an owning band/group are rows, not standalone
 * command cards. The parent surface owns any outside corner clipping. */
[data-ds-button-shape="group-row"] {
  border-radius: var(--ds-group-row-radius) !important;
}

[data-ds-button-shape="surface"] {
  border-radius: var(--ds-interactive-surface-radius) !important;
}

/*
 * Disabled command-state contract.
 * Do not fade the entire control: opacity also fades its label and lets
 * unrelated hover rules create low-contrast color combinations.
 */
:is(
  .ds-btn,
  [data-ds-button],
  [data-ds-button-variant="primary"],
  [class*="--primary"],
  .is-primary,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .btn-danger,
  .qadd-btn,
  .ctb-pill,
  .ctb-waitlist,
  .app-modal__btn,
  .settings-establishment-btn,
  .marketing-btn,
  .founder-ctl-btn,
  .dsh-btn,
  .sm-btn,
  .se-btn,
  .rdv2__btn,
  .pos-dd-btn,
  .cal-v4-appt-create__btn,
  .cal-v4-apptc2__btn,
  .cal-v4-appt-detail__btn,
  .cal-v4-appt-edit__save,
  .cal-v4-blocked-time__save,
  .cal-v4-drawer__empty-action,
  .cal-v4-empty__cta,
  .cal-v4-staging-drawer__walkin-addbtn,
  .cal-v4-staging-drawer__walkin-save,
  .cal-waitlist-drawer__booksubmit,
  .cal-waitlist-new-client__ghost,
  .cal-waitlist-new-client__save,
  .settings-savebar button,
  .staff-create-btn-cancel,
  .staff-create-btn-submit,
  .sales-home-btn,
  .sales-home-cta,
  .sales-landing-cta,
  .sov-cta,
  .sc-cta,
  .app-toast__action
):is(:disabled, [aria-disabled="true"], .is-disabled) {
  background: var(--ds-color-button-disabled-bg) !important;
  border-color: var(--ds-color-button-disabled-border) !important;
  color: var(--ds-color-button-disabled-text) !important;
  box-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;
  pointer-events: none !important;
  transform: none !important;
  cursor: default !important;
}

/* Native and ARIA-disabled controls must never enter an interactive hover state. */
:where(button:disabled, [role="button"][aria-disabled="true"], a[aria-disabled="true"]) {
  pointer-events: none !important;
  cursor: default !important;
}
/* Form wrappers that participate in an inline command group. */
.ds-inline-form {
  display: inline;
  margin: 0;
}
