/* Framework-independent primitives. Keep financial visibility in controllers/templates. */
.rafo-surface {
  min-inline-size: 0;
  padding: var(--rf-space-5);
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius-panel);
  background: var(--rf-raised);
  color: var(--rf-ink);
  box-shadow: var(--rf-shadow);
}
.rafo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rf-space-3);
}
.rafo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rf-space-2);
  min-block-size: var(--rf-control-height);
  max-inline-size: 100%;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--rf-radius-pill);
  background: var(--rf-button-bg);
  color: var(--rf-button-ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.rafo-button--secondary {
  border-color: var(--rf-hairline);
  background: var(--rf-raised);
  color: var(--rf-ink);
}
.rafo-button:disabled, .rafo-button[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}
.rafo-button svg { inline-size: 20px; block-size: 20px; flex: none; }
.rafo-button:focus-visible, .rafo-field:focus-visible {
  outline: 3px solid var(--rf-focus);
  outline-offset: 3px;
}
.rafo-field {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: var(--rf-control-height);
  padding: 12px 16px;
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius-control);
  background: var(--rf-raised);
  color: var(--rf-ink);
  font: inherit;
}
.rafo-page-title {
  margin: 0;
  color: var(--rf-ink);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.rafo-customer { font-family: var(--rf-font); }
.rafo-customer > .flex { background: var(--rf-workspace); }
.rafo-customer .rafo-content {
  max-inline-size: var(--rf-page-width);
  padding-block: clamp(24px, 4vw, 48px);
}
.rafo-home { gap: var(--rf-space-5); }
.rafo-home-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--rf-space-5); }
.rafo-section-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-block-end: 20px; }
.rafo-section-heading h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--rf-ink); }
.rafo-section-heading > a { margin-inline-start: auto; color: var(--rf-accent); font-size: 14px; font-weight: 600; min-block-size: 44px; display: inline-flex; align-items: center; }
.rafo-home-card { display: block; color: var(--rf-ink); text-decoration: none; margin-block-end: 16px; }
.rafo-home-card-status { display: inline-block; margin-block-start: 12px; font-size: 14px; font-weight: 600; }
.rafo-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 12px; color: var(--rf-quiet); text-align: center; }
.rafo-home-overview { display: grid; gap: var(--rf-space-5); min-inline-size: 0; }
.rafo-balance-hero {
  position: relative;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius-panel);
  background: var(--rf-accent-soft);
  color: var(--rf-ink);
  min-inline-size: 0;
}
.rafo-balance-hero [data-balance-toggle] { min-inline-size: 44px; min-block-size: 44px; }
.rafo-balance-hero [data-ccy-btn] { min-block-size: 44px; }
.rafo-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--rf-space-3);
}
.rafo-quick-actions .bg-accent { background: var(--rf-button-bg); color: var(--rf-button-ink); }
.rafo-quick-actions > a { min-inline-size: 0; text-align: center; }
.rafo-quick-actions > a > span:last-child { white-space: normal; overflow-wrap: anywhere; }
.rafo-balance-section .balance-tile { background: var(--rf-workspace); border: 1px solid var(--rf-hairline); }
.rafo-transfer {
  max-inline-size: 800px;
  margin-inline: auto;
  gap: var(--rf-space-5);
  padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius-panel);
  background: var(--rf-raised);
}
.rafo-transfer .xfer-head h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.rafo-transfer .xfer-method-card { border-radius: 16px; background: var(--rf-workspace); }
.rafo-cards-stage {
  padding: clamp(16px, 3vw, 32px);
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius-panel);
  background: var(--rf-raised);
  min-inline-size: 0;
}
.rafo-cards-stage .wallet-card-choice { min-block-size: 44px; }
.rafo-cards-stage .wallet-card-choice[aria-pressed="true"] {
  color: var(--rf-focus);
  border-color: var(--rf-focus);
}
.rafo-cards-stage #emptyState a { min-block-size: 48px; }
/* Admin retains native EasyAdmin behaviour and its operational density. */
body.ea { --db-card-bg: var(--rf-raised); --db-border: var(--rf-hairline); }
body.ea .main-content { background: var(--rf-workspace); }
body.ea .ea-card { border-radius: 20px; box-shadow: var(--rf-shadow); }
body.ea .thunes-panel { background: var(--rf-raised); }
@media (min-width: 1024px) {
  .rafo-home-overview { grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr); align-items: center; }
  .rafo-home-detail-grid { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); align-items: start; }
}
@media (max-width: 639px) {
  .rafo-surface { padding: var(--rf-space-4); border-radius: 20px; }
  .rafo-balance-section .balance-tile { padding: 12px; gap: 8px; }
  .rafo-balance-section .balance-tile-disc { inline-size: 28px; block-size: 28px; }
  .rafo-balance-section .balance-tile-amount { font-size: 16px; }
  .rafo-transfer, .rafo-cards-stage { padding: 16px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .rafo-button, .rafo-quick-actions *, .rafo-transfer .xfer-method-card { transition: none; }
}

/* Shared adapters for existing customer, authentication and native admin families.
   These selectors change presentation only; state/visibility and actions stay native. */
.rafo-customer .page-stack { gap: var(--rf-space-5); min-inline-size: 0; }
.rafo-customer .page-stack > .surface-raised {
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius-panel);
  background: var(--rf-raised);
}
.rafo-customer .page-stack :is(h1,h2,h3) { overflow-wrap: anywhere; }
.rafo-customer .page-stack :is(form,fieldset,section,article) { min-inline-size: 0; }
.rafo-customer :is(button,a,input,select,textarea):focus-visible,
.rafo-auth :is(button,a,input,select,textarea):focus-visible {
  outline: 3px solid var(--rf-focus); outline-offset: 3px;
}
.rafo-auth { font-family: var(--rf-font); background: var(--rf-canvas); color: var(--rf-ink); }
.rafo-auth .auth-container { min-inline-size: 0; }
.rafo-auth :is(input,select,textarea) { max-inline-size: 100%; }
body.ea .content-wrapper .btn { min-block-size: 40px; gap: 8px; white-space: normal; overflow-wrap: anywhere; }
body.ea .content-wrapper .btn-primary { background: var(--rf-button-bg); border-color: var(--rf-button-bg); color: var(--rf-button-ink); }
body.ea .content-wrapper :is(.form-control,.form-select):focus-visible { outline: 3px solid var(--rf-focus); outline-offset: 2px; }
@media (max-width: 639px) {
  .rafo-customer .page-stack { gap: var(--rf-space-4); }
  .rafo-customer .page-stack > .surface-raised { border-radius: 20px; }
}
