/* =====================================================================
   Batch 1 — legacy class aliases onto Clear Service primitives.
   Existing templates still emit .button / .card / .form-card / .notice /
   .status / .badge / .actions. Journey batches migrate markup to .rc-*.
   Do not reintroduce separate primitive definitions in app.css.
   ===================================================================== */

/* Buttons: map legacy .button (and unclassed form buttons) onto .rc-btn */
.button,
button:not([class]),
button.primary,
button.secondary,
button.danger,
.button.primary,
.button.secondary,
.button.danger {
  --_ring: var(--rc-grad-primary);
  --_ring-hover: var(--rc-grad-primary-hover);
  --_bw: var(--rc-border-action-strong);
  --_fg: var(--rc-ink-900);
  --_tint: var(--rc-blue-50);
  --_press: var(--rc-blue-100);
  --_shadow: var(--rc-shadow-primary);
  --_halo: var(--rc-halo);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rc-icon-to-label);
  min-height: var(--rc-btn-h);
  min-width: 8.5rem;
  max-width: 100%;
  padding: 0 28px;
  border: var(--_bw) solid transparent;
  box-sizing: border-box;
  border-radius: var(--rc-radius-pill);
  background: linear-gradient(#fff, #fff) padding-box, var(--_ring) border-box;
  color: var(--_fg);
  font-family: var(--rc-font);
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 720;
  letter-spacing: -.006em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--_shadow);
  transition: box-shadow var(--rc-dur-micro) var(--rc-ease-standard), color var(--rc-dur-micro) var(--rc-ease-standard);
  transform: none;
}
.button.secondary,
button.secondary,
.secondary {
  --_ring: var(--rc-grad-secondary);
  --_ring-hover: var(--rc-grad-secondary-hover);
  --_bw: var(--rc-border-action);
  --_fg: var(--rc-blue-700);
  --_tint: var(--rc-blue-50);
  --_press: var(--rc-blue-100);
  --_shadow: 0 0 0 0 transparent;
}
.button.danger,
button.danger {
  --_ring: var(--rc-grad-danger);
  --_ring-hover: var(--rc-grad-danger);
  --_bw: var(--rc-border-action-strong);
  --_fg: var(--rc-danger-fg);
  --_tint: var(--rc-danger-bg);
  --_press: #f8d7d3;
  --_shadow: 0 0 0 0 transparent;
  --_halo: var(--rc-halo-danger);
}
.button:hover,
button:not([class]):hover,
button.primary:hover,
button.secondary:hover,
button.danger:hover,
.button.primary:hover,
.button.secondary:hover,
.button.danger:hover {
  --_ring: var(--_ring-hover);
  box-shadow: var(--_halo);
  transform: none;
}
/* Exclude .rc-btn / .rc-icon-btn — Clear Service owns their disabled chrome.
   Also exclude dual-class `.button.rc-btn` so legacy opacity cannot fight components. */
.button:disabled:not(.rc-btn):not(.rc-icon-btn),
button:disabled:not(.rc-btn):not(.rc-icon-btn),
.button[aria-disabled="true"]:not(.rc-btn):not(.rc-icon-btn),
button[aria-disabled="true"]:not(.rc-btn):not(.rc-icon-btn),
a.button[aria-disabled="true"]:not(.rc-btn),
span.button[aria-disabled="true"]:not(.rc-btn),
span[role="link"][aria-disabled="true"] {
  --_ring: var(--rc-grad-disabled);
  --_fg: var(--rc-ink-500);
  --_shadow: none;
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.button.is-loading:not(.rc-btn),
button.is-loading:not(.rc-btn),
button[aria-busy="true"]:not(.rc-btn),
.button[aria-busy="true"]:not(.rc-btn) {
  pointer-events: none;
  cursor: wait;
  opacity: .72;
}
.button.full,
button.full {
  width: 100%;
  max-width: 28rem;
  margin-inline: auto;
}
/* Plain text links only — never collapse Clear Service .rc-btn padding. */
.text-button:not(.rc-btn),
.text-button:not(.rc-btn):hover {
  background: none;
  border: 0;
  box-shadow: none;
  min-width: 0;
  min-height: var(--rc-target);
  padding: 4px 12px;
  color: var(--rc-blue-700);
  border-radius: 0;
  --_ring: none;
  --_shadow: none;
  --_halo: none;
}
.button:focus-visible,
button:not([class]):focus-visible {
  outline: 3px solid var(--rc-focus-color);
  outline-offset: 3px;
}

/* Cards */
.card,
.form-card,
.ui-panel {
  background: var(--rc-surface);
  border: var(--rc-border-hair) solid var(--rc-line);
  border-radius: var(--rc-radius-lg);
  box-shadow: var(--rc-shadow-1);
}
.form-card {
  padding: var(--rc-card-pad);
}
.ui-panel-tint,
.stat-card,
.next-action-card {
  background: var(--rc-wash-card);
  border-color: var(--rc-line);
}
.ui-panel-feature {
  background: var(--rc-wash-feature);
  border: var(--rc-border-hair) solid var(--rc-line-strong);
}

/* Notices → alert tones */
.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--rc-space-3);
  align-items: start;
  padding: var(--rc-space-4);
  border-radius: var(--rc-radius-md);
  border: var(--rc-border-hair) solid var(--rc-info-line);
  background: var(--rc-info-bg);
  color: var(--rc-info-fg);
}
.notice.error,
.notice.danger {
  border-color: var(--rc-danger-line);
  background: var(--rc-danger-bg);
  color: var(--rc-danger-fg);
}
.notice.success {
  border-color: var(--rc-success-line);
  background: var(--rc-success-bg);
  color: var(--rc-success-fg);
}
.notice.warning {
  border-color: var(--rc-warning-line);
  background: var(--rc-warning-bg);
  color: var(--rc-warning-fg);
}
.notice p:last-child { margin-bottom: 0; }
/* Partner join success: .notice’s default two-column grid clips stacked actions on phones. */
.notice.join-success {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--rc-space-3);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.notice.join-success > * {
  min-width: 0;
  max-width: 100%;
}

/* Status / badge */
.status,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: var(--rc-radius-pill);
  border: var(--rc-border-hair) solid var(--rc-neutral-line);
  background: var(--rc-neutral-bg);
  color: var(--rc-neutral-fg);
  font-size: var(--rc-text-meta);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.status.subtle,
.badge.subtle {
  background: transparent;
  border-color: transparent;
  color: var(--rc-ink-600);
  padding-inline: 0;
}

/* Action groups */
.actions,
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rc-action-gap);
  align-items: center;
}
.action-group,
.actions.action-group,
.actions-centred {
  justify-content: center;
}
.actions-follow { margin-top: var(--rc-space-2); }

/* Empty */
.empty,
.ui-empty {
  text-align: center;
  padding: var(--rc-space-7) var(--rc-space-4);
  color: var(--rc-ink-600);
}

/* Keep journey CSS spacing tokens that predate makeover names */
:root {
  --accent: var(--rc-brand-blue);
  --accent-deep: var(--rc-blue-600);
  --rc-accent: var(--rc-brand-blue);
  --rc-accent-deep: var(--rc-blue-600);
  --rc-ink: var(--rc-ink-900);
  --rc-ink-soft: var(--rc-ink-700);
  --rc-muted: var(--rc-ink-600);
  --rc-mist: var(--rc-surface-soft);
  --rc-surface-mist: var(--rc-wash-card);
  --rc-surface-panel: var(--rc-wash-feature);
  --rc-focus: var(--rc-focus-color);
  --rc-success: var(--rc-success-fg);
  --rc-danger: var(--rc-danger-fg);
  --rc-gradient: var(--rc-grad-primary);
  --rc-gradient-hover: var(--rc-grad-primary-hover);
  --rc-gradient-secondary: var(--rc-grad-secondary);
  --rc-gradient-danger: var(--rc-grad-danger);
  --space-1: var(--rc-space-1);
  --space-2: var(--rc-space-2);
  --space-3: var(--rc-space-3);
  --space-4: var(--rc-space-4);
  --space-5: var(--rc-space-6);
  --space-6: var(--rc-space-7);
  --space-7: var(--rc-space-8);
  --space-8: var(--rc-space-9);
  --space-9: var(--rc-space-10);
  --space-label-control: var(--rc-label-to-control);
  --space-control-help: var(--rc-control-to-help);
  --space-field: var(--rc-field-gap);
  --space-related: var(--rc-stack-related);
  --space-section: var(--rc-section-gap);
  --space-card-pad-mobile: 18px;
  --space-card-pad: var(--rc-card-pad);
  --space-page-gutter-mobile: 18px;
  --space-page-gutter: var(--rc-gutter);
  --space-action-gap: var(--rc-action-gap);
  --space-icon-label: var(--rc-icon-to-label);
  --space-nav-item: var(--rc-nav-pad-y);
  --font-body: var(--rc-font);
  --text-body: var(--rc-text-body);
  --text-label: .92rem;
  --text-meta: var(--rc-text-meta);
  --text-eyebrow: var(--rc-text-eyebrow);
  --leading-body: var(--rc-lh-body);
  --leading-tight: var(--rc-lh-title);
  --title-page: var(--rc-text-title);
  --title-section: var(--rc-text-section);
  --title-task: var(--rc-text-title);
  --title-ops: var(--rc-text-section);
  --title-marketing: var(--rc-text-display);
  --radius-control: var(--rc-radius-sm);
  --radius-card: var(--rc-radius-lg);
  --radius-pill: var(--rc-radius-pill);
  --shadow-soft: var(--rc-shadow-1);
  --shadow-lift: var(--rc-shadow-2);
  --border-action: var(--rc-border-action-strong);
  --action-radius: var(--rc-radius-pill);
  --action-border: var(--rc-border-action-strong);
  --motion-fast: var(--rc-dur-micro);
  --motion-med: var(--rc-dur-dialog);
  --motion-ease: var(--rc-ease-standard);
  --motion: var(--rc-dur-micro);
  --z-sticky: var(--rc-z-sticky);
  --z-overlay: var(--rc-z-overlay);
  --z-dialog: var(--rc-z-dialog);
}
.theme-ocean { --accent: var(--rc-brand-blue); --accent-deep: var(--rc-blue-600); }
.theme-green { --accent: #185f4e; --accent-deep: #0f4337; }
.theme-indigo { --accent: #3f4e8c; --accent-deep: #2c3866; }
