/* Global flat UI override layer.
   Loaded after shared shell styles so the platform uses one square-edged language. */

:where(.ep-page, .cm-auth-page) {
  --cm-type-xs: 0.58rem;
  --cm-type-sm: 0.64rem;
  --cm-type-base: 0.72rem;
  --cm-type-md: 0.76rem;
  --cm-type-lg: 0.84rem;
  --cm-type-xl: 0.94rem;
  --cm-type-2xl: 1.05rem;
  --cm-type-3xl: 1.16rem;
  font-size: var(--cm-type-base);
}

:where(.ep-page, .cm-auth-page) :where(.text-xs) {
  font-size: var(--cm-type-xs) !important;
  line-height: 0.95rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-sm, .muted) {
  font-size: var(--cm-type-sm) !important;
  line-height: 1.08rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-base) {
  font-size: var(--cm-type-base) !important;
  line-height: 1.18rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-lg) {
  font-size: var(--cm-type-md) !important;
  line-height: 1.22rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-xl) {
  font-size: var(--cm-type-lg) !important;
  line-height: 1.28rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-2xl) {
  font-size: var(--cm-type-xl) !important;
  line-height: 1.34rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-3xl) {
  font-size: var(--cm-type-2xl) !important;
  line-height: 1.45rem !important;
}

:where(.ep-page, .cm-auth-page) :where(.text-4xl, .text-5xl, .text-6xl) {
  font-size: var(--cm-type-3xl) !important;
  line-height: 1.62rem !important;
}

:where(.ep-page, .cm-auth-page) :where(
  h1,
  .cm-topbar__title,
  .ep-page-heading,
  .cart-retail-title,
  .product-retail-title,
  .retail-hero__title,
  .lp-hero-title,
  .auth-title
) {
  font-size: clamp(0.96rem, 0.72vw + 0.78rem, 1.18rem) !important;
  line-height: 1.08 !important;
}

:where(.ep-page, .cm-auth-page) :where(
  h2,
  .ep-card__title,
  .cms-panel__title,
  .ep-toolbar-card__title,
  .cart-panel__title,
  .product-section__title,
  .retail-section__title
) {
  font-size: clamp(0.78rem, 0.32vw + 0.68rem, 0.9rem) !important;
  line-height: 1.18 !important;
}

:where(.ep-page, .cm-auth-page) :where(h3, h4, h5, h6) {
  font-size: clamp(0.72rem, 0.24vw + 0.64rem, 0.84rem) !important;
  line-height: 1.2 !important;
}

:where(.ep-page, .cm-auth-page) :where(
  p,
  li,
  label,
  summary,
  td,
  th,
  input,
  select,
  textarea,
  button,
  .ep-btn,
  .btn,
  .auth-input,
  .auth-btn,
  .cm-topbar__cta,
  .cm-sidebar__item-label,
  .cm-sidebar__child,
  .cm-user-toggle__name,
  .cm-user-panel__link,
  .cm-user-panel__button,
  .cm-user-panel__switch button,
  .cm-user-panel__switch-current,
  .store-product-card,
  .retail-card,
  .cart-line,
  .cart-summary-card,
  .checkout-panel,
  .qc-modal
) {
  font-size: var(--cm-type-base) !important;
}

:where(.ep-page, .cm-auth-page) :where(
  small,
  .help,
  .helptext,
  .ep-field__help,
  .ep-field__error,
  .ep-card__subtitle,
  .cms-panel__subtitle,
  .ep-toolbar-card__text,
  .cm-topbar__kicker,
  .cm-page-breadcrumbs,
  .cm-user-toggle__label,
  .cm-user-panel__title,
  .cm-user-panel__meta,
  .ep-badge,
  .badge,
  .cm-admin-chip,
  .cart-summary-note
) {
  font-size: var(--cm-type-sm) !important;
}

:where(.ep-page, .cm-auth-page) :where(
  .ep-summary-card__value,
  .cms-kpi__value,
  .dashboard-shell-metric__value,
  .cart-summary-card__total,
  .product-retail-price,
  .retail-card__price
) {
  font-size: clamp(0.86rem, 0.42vw + 0.74rem, 1rem) !important;
  line-height: 1.12 !important;
}

:where(.ep-page, .cm-auth-page) {
  --radius: 0px !important;
}

:where(.ep-page, .cm-auth-page) [class*="rounded"],
:where(.ep-page, .cm-auth-page) [style*="border-radius"] {
  border-radius: 0 !important;
}

:where(.ep-page, .cm-auth-page) :where(
  a[class],
  button,
  input,
  select,
  textarea,
  fieldset,
  summary,
  dialog,
  iframe,
  [role="button"],
  [role="tab"],
  [role="menu"],
  [role="menuitem"],
  [role="listbox"],
  [role="tabpanel"],
  [role="dialog"],
  [class*="card"],
  [class*="panel"],
  [class*="modal"],
  [class*="dialog"],
  [class*="badge"],
  [class*="pill"],
  [class*="chip"],
  [class*="btn"],
  [class*="button"],
  [class*="tab"],
  [class*="input"],
  [class*="select"],
  [class*="textarea"],
  [class*="menu"],
  [class*="dropdown"],
  [class*="avatar"],
  [class*="summary"],
  [class*="toolbar"],
  [class*="sidebar"],
  [class*="table-wrap"],
  [class*="table-card"],
  [class*="search"],
  [class*="field"],
  [class*="toggle"],
  [class*="switch"],
  [class*="message"],
  [class*="notice"],
  [class*="hero-badge"],
  [class*="icon"],
  .ep-brand,
  .ep-header,
  .ep-card,
  .ep-btn,
  .ep-tab,
  .ep-field,
  .ep-table-wrap,
  .ep-summary-card,
  .ep-empty-state,
  .ep-message,
  .ep-toolbar-card,
  .ep-disclosure,
  .ep-modal,
  .lp-nav-link,
  .lp-nav-cta,
  .lp-hero-badge,
  .lp-btn,
  .lp-benefit,
  .lp-benefit-icon,
  .lp-feature,
  .lp-feature-icon,
  .lp-solution-visual,
  .lp-step-num,
  .auth-card,
  .auth-input,
  .auth-btn,
  .auth-badge,
  .cm-shell,
  .cm-sidebar__brand-mark,
  .cm-sidebar__item,
  .cm-sidebar__child,
  .cm-sidebar__plan-card,
  .cm-sidebar__paywall-card,
  .cm-sidebar__footer-link,
  .cm-sidebar-toggle,
  .cm-icon-button,
  .cm-user-toggle,
  .cm-user-panel,
  .cm-user-panel__link,
  .cm-user-panel__button,
  .cm-user-panel__switch button,
  .cm-user-panel__switch-current,
  .cm-topbar__search,
  .cm-topbar__cta,
  .cm-avatar,
  .cm-notice-rail__pill,
  .cm-notice-rail__cta,
  .cm-notice-rail__dismiss,
  .b2b-sidebar-summary,
  .b2b-sidebar-summary__progress,
  .b2b-sidebar-summary__action,
  .b2b-context-banner,
  .b2b-tier-progress__track,
  .rd-toolbar,
  .rd-table-card,
  .rd-card,
  .rd-btn,
  .rd-pill,
  .rd-chip,
  .vnd-card,
  .vnd-btn,
  .aff-card,
  .aff-btn
) {
  border-radius: 0 !important;
}

:where(.ep-page, .cm-auth-page) :where(.cm-shell, .cm-sidebar, .cm-topbar, .ep-header, .ep-main, .lp-nav, .lp-hero, .lp-footer) {
  border-radius: 0 !important;
}

:where(.ep-page, .cm-auth-page) :where(
  a[href],
  button,
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="tab"],
  [role="menuitem"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand-color, #cb0b0b) 78%, transparent) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

:where(.ep-page, .cm-auth-page) :where(
  button[disabled],
  input[disabled],
  select[disabled],
  textarea[disabled],
  .ep-btn[aria-disabled="true"],
  .cm-topbar__cta[aria-disabled="true"]
) {
  opacity: 0.58 !important;
  cursor: not-allowed !important;
}

:where(.ep-page, .cm-auth-page) :where(
  tr[data-row-link],
  .cm-sidebar__item,
  .cm-sidebar__child,
  .cm-user-panel__link,
  .cm-user-panel__button,
  .ep-tab,
  .ep-btn,
  .cm-topbar__cta
) {
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease !important;
}

:where(.ep-page, .cm-auth-page) tr[data-row-link]:hover > td,
:where(.ep-page, .cm-auth-page) tr[data-row-link]:focus-visible > td {
  background: color-mix(in srgb, var(--brand-color, #cb0b0b) 5%, transparent) !important;
}
