:root {
  --radius-control: 6px;
  --radius-control-sm: 4px;
  --radius-surface: 8px;
  --radius-dialog: 10px;
}

/* Enterprise radius baseline for interactive controls. Keep true status/avatar/progress circles intact. */
:is(
  button,
  [role="button"],
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,
  select,
  [role="combobox"],
  [aria-haspopup="listbox"],
  [data-state][aria-haspopup],
  .app-page-tabs > button,
  .sidebar-nav-item,
  .sidebar-profile-card,
  .task-list-toolbar-btn,
  .task-list-action-btn,
  .result-modal-btn,
  .store-mgm-action-btn,
  .btn-primary,
  .practice-tool-btn,
  .assistant-btn-primary,
  .assistant-btn-secondary,
  .quick-query-bar-btn,
  .db-btn-primary,
  .db-btn-secondary,
  .db-date-toggle,
  .db-date-btn,
  .home-lx-button,
  .dh-menu-button,
  .dh-sidepanel-toggle,
  .dh-sp-btn,
  .dh-speech-bubble__action,
  .dh-sp-header__close,
  .agent-activity-toggle,
  .agent-activity-tab,
  .agent-orchestration-agent-button,
  .employee-journey-modal__close,
  .wq-dim-chip,
  .wq-source-tab,
  .wq-card-action,
  .wq-card-mastered-btn,
  .wq-dialog-close,
  .wq-dialog-cancel,
  .wq-dialog-confirm,
  .wq-scope-option,
  .wq-scope-select,
  .wq-picker-option,
  .wq-picker__trigger,
  .kf-dispatch-btn,
  .kf-refresh-btn,
  .kf-dialog-close,
  .kf-dispatch-cancel,
  .kf-dispatch-confirm
) {
  border-radius: var(--radius-control) !important;
}

:is(
  .rounded-full,
  .rounded-xl,
  .rounded-2xl,
  .rounded-3xl,
  [class*="rounded-[22px]"]
):is(button, [role="button"], input, textarea, select) {
  border-radius: var(--radius-control) !important;
}

:is(
  button[class*="rounded-full"],
  button[class*="rounded-xl"],
  button[class*="rounded-2xl"],
  button[class*="rounded-3xl"],
  [role="button"][class*="rounded-full"],
  [role="button"][class*="rounded-xl"],
  [role="button"][class*="rounded-2xl"],
  [role="button"][class*="rounded-3xl"]
) {
  border-radius: var(--radius-control) !important;
}

/* Small icon buttons should still feel precise, not pill-shaped. */
:is(
  button.w-7,
  button.w-8,
  button.w-9,
  button.h-7,
  button.h-8,
  button.h-9,
  .dh-sidepanel-toggle,
  .dh-menu-button,
  .agent-activity-toggle,
  .employee-journey-modal__close,
  .wq-dialog-close,
  .kf-dialog-close
) {
  border-radius: var(--radius-control) !important;
}

/* Compact form controls and dropdown menus. */
:is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,
  select,
  [role="listbox"],
  .wb-store-picker__btn,
  .wq-picker__trigger,
  .wq-scope-select,
  .quick-query-bar-field,
  .assistant-spotlight-field,
  .assistant-spotlight-input,
  .db-date-field,
  .flatpickr-calendar
) {
  border-radius: var(--radius-control) !important;
}

/* Surfaces can keep a slightly softer shape without reading as consumer-app bubbles. */
:is(
  .ios-sheet-card,
  .ios-modal,
  .ios-modal-card,
  .modal-card,
  .agent-activity-panel,
  .agent-activity-bubble,
  .assistant-cc-glass,
  .assistant-cc-reply-main,
  .quick-query-bar-shell,
  .db-calendar-panel,
  .training-mobile-card,
  .tm-detail-modal-card,
  .store-modal-card,
  .rounded-2xl.bg-white,
  .rounded-3xl.bg-white
):not(button):not([role="button"]):not(input):not(textarea):not(select) {
  border-radius: var(--radius-dialog) !important;
}

:is(
  .rounded-xl.bg-white,
  .rounded-xl.border,
  .rounded-xl.shadow-sm,
  .rounded-xl[class*="shadow"],
  article.rounded-xl,
  div.rounded-xl.border
):not(button):not([role="button"]):not(input):not(textarea):not(select) {
  border-radius: var(--radius-surface) !important;
}

/* Explicitly preserve semantic circular visuals. */
:is(
  #avatar-letter,
  #acc-modal-avatar,
  .avatar,
  .user-avatar,
  .typing-dot,
  .dh-loading-dot,
  .agent-activity-status-dot,
  .agent-orchestration-agent-button__dot,
  .employee-journey-node__dot,
  .employee-journey-timeline__dot,
  .wq-recurring-dot,
  .rounded-full:not(button):not([role="button"]):not(input):not(textarea):not(select),
  [class*="rounded-full"]:not(button):not([role="button"]):not(input):not(textarea):not(select)
) {
  border-radius: 9999px !important;
}

.agent-orchestration-workflow__state::before {
  border-radius: 9999px !important;
}

/* Progress bars and sliders need fully rounded ends for legibility. */
:is(
  progress,
  [role="progressbar"],
  .progress-bar,
  .progress-fill,
  .h-1.rounded-full,
  .h-1\.5.rounded-full,
  .h-2.rounded-full,
  .h-2\.5.rounded-full,
  .h-full.rounded-full,
  .w-full.h-1\.5,
  .w-full.h-2,
  .w-full.h-2\.5
) {
  border-radius: 9999px !important;
}
