/* Shared referral dashboard in the account area and Refer & Earn page. */
.refer-rate small { display: block; color: #fff; font-size: 13px; font-weight: 700; margin-top: 2px; }
.refer-page .hero-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; }
.refer-page .hero-badges span { display: inline-flex; align-items: center; gap: 6px; }
.refer-page .hero-badges i { color: var(--gold); }
.refer-page .steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.refer-page .step-card { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.refer-page .step-num { display: block; color: var(--gold-dark); font-size: 12px; font-weight: 800; margin-bottom: 16px; }
.refer-page .step-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: #eaf3ff; color: var(--primary); font-size: 19px; margin-bottom: 16px; }
.refer-page .step-card h3 { font-size: 18px; margin-bottom: 8px; }
.refer-page .step-card p { color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.refer-page .rules-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 30px; }
.refer-page .rule-item { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 20px 0; border-top: 1px solid var(--border); }
.refer-page .rule-item > i { flex: 0 0 20px; color: var(--primary); font-size: 18px; margin-top: 2px; }
.refer-page .rule-item b, .refer-page .rule-item span { display: block; }
.refer-page .rule-item b { font-size: 15px; margin-bottom: 7px; }
.refer-page .rule-item span { color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.refer-page .faq-wrap { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--border); }
.refer-page .faq-item { border-bottom: 1px solid var(--border); }
.refer-page .faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 4px; cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; }
.refer-page .faq-item summary::-webkit-details-marker { display: none; }
.refer-page .faq-item summary::after { content: '+'; color: var(--primary); font-size: 22px; font-weight: 400; line-height: 1; }
.refer-page .faq-item[open] summary::after { content: '\2212'; }
.refer-page .faq-body { padding: 0 4px 18px; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.refer-page .refer-actions .btn { margin: 4px 6px !important; }
.affiliate-dash, .aff-tables { min-width: 0; }
.affiliate-dash .aff-share, .affiliate-dash .aff-withdraw-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 22px; margin-bottom: 18px;
}
.affiliate-dash .aff-share { border-top: 3px solid var(--primary); }
.aff-share-top { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(240px, 1fr); gap: 20px; align-items: center; }
.aff-share-top p { color: var(--text-muted); font-size: 13px; line-height: 1.65; margin: 0; }
.aff-eyebrow, .aff-share-code span, .aff-share-link label, .aff-field label {
  display: block; color: var(--text-muted); font-size: 12px; font-weight: 700; margin-bottom: 6px;
}
.aff-rate { color: var(--primary); font-size: 40px; line-height: 1.05; font-weight: 800; }
.aff-level { display: inline-block; color: var(--gold-dark); font-size: 12px; font-weight: 800; margin-top: 8px; }
.aff-share-fields { display: grid; grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); gap: 18px; align-items: end; border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; }
.aff-share-code strong { display: block; font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.aff-link-row { display: flex; gap: 9px; min-width: 0; }
.aff-link-row input, .aff-field input, .aff-field select {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--border-dark); border-radius: 6px; background: #fff; color: var(--text);
}
.aff-link-row input { flex: 1; background: var(--bg-light); }
.aff-link-row button { flex: 0 0 auto; min-height: 42px; }
.aff-link-row button.is-copied { background: #16704a; border-color: #16704a; }
.aff-copy-feedback { display: block; min-height: 19px; color: #16704a; font-size: 12px; margin-top: 4px; }
.affiliate-dash .aff-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.affiliate-dash .aff-stat { min-width: 0; border-radius: 8px; padding: 15px; }
.affiliate-dash .aff-stat-main { background: #f5f9ff; border-color: #cbdcf0; }
.affiliate-dash .aff-stat b { font-size: 21px; overflow-wrap: anywhere; }
.aff-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.aff-section-head h3 { margin: 0; }
.aff-section-head span { color: var(--text-muted); font-size: 12px; }
.aff-withdraw-card > p { margin: 8px 0 16px; }
.aff-withdraw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.aff-field { min-width: 0; }
.aff-field-address { grid-column: span 2; }
.aff-field-memo[hidden] { display: none; }
.aff-field input:focus, .aff-field select:focus, .aff-link-row input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.aff-form-feedback { color: #b91c1c; min-height: 21px; font-size: 12px; margin: 9px 0; }
.aff-unavailable { color: var(--text-muted); font-size: 13px; background: var(--bg-light); padding: 12px; border-radius: 6px; }
.aff-table { width: 100%; min-width: 620px; }
.aff-withdraw-table { min-width: 760px; }
.aff-detail-stack strong, .aff-detail-stack span, .aff-detail-stack small { display: block; }
.aff-address, .aff-reference { overflow-wrap: anywhere; word-break: break-word; }
.aff-withdraw-detail .aff-address { font-size: 12px; max-width: 230px; }
.aff-reference { max-width: 240px; font-size: 12px !important; }
.affiliate-dash .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.aff-confirm { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.aff-confirm::backdrop { background: rgba(15,23,42,.6); }
.aff-confirm h3 { margin: 0 0 8px; }
.aff-confirm p { color: var(--text-muted); font-size: 13px; }
.aff-confirm dl { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 8px 12px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.aff-confirm dt { color: var(--text-muted); font-size: 12px; }
.aff-confirm dd { margin: 0; font-size: 13px; font-weight: 700; }
.aff-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.aff-loading { min-height: 120px; }

@media (max-width: 900px) {
  .refer-page .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .affiliate-dash .aff-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aff-withdraw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aff-field-address { grid-column: auto; }
}
@media (max-width: 575px) {
  .refer-page .steps-grid, .refer-page .rules-list { grid-template-columns: 1fr; }
  .refer-page .step-card { padding: 18px; }
  .refer-page .hero-badges { gap: 8px 14px; font-size: 12px; }
  .refer-page .refer-actions .btn { display: flex; justify-content: center; width: 100%; margin: 8px 0 !important; }
  .affiliate-dash .aff-share, .affiliate-dash .aff-withdraw-card { padding: 16px; }
  .aff-share-top, .aff-share-fields, .aff-withdraw-grid { grid-template-columns: 1fr; gap: 12px; }
  .aff-share-fields { margin-top: 14px; }
  .aff-rate { font-size: 34px; }
  .affiliate-dash .aff-stat b { font-size: 18px; }
  .aff-link-row { flex-wrap: wrap; }
  .aff-link-row input { flex-basis: 100%; }
  .aff-link-row button { width: 100%; }
  .aff-section-head { display: block; }
  .aff-section-head span { display: block; margin-top: 4px; }
  .affiliate-dash .aff-table { min-width: 0; }
  .affiliate-dash .aff-table thead { display: none; }
  .affiliate-dash .aff-table tbody, .affiliate-dash .aff-table tr { display: block; }
  .affiliate-dash .aff-table tr { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 10px; padding: 6px 10px; background: #fff; }
  .affiliate-dash .aff-table td { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 12px; text-align: right; }
  .affiliate-dash .aff-table td:last-child { border-bottom: 0; }
  .affiliate-dash .aff-table td::before { content: attr(data-label); color: var(--text-muted); font-weight: 700; text-align: left; flex: 0 0 94px; }
  .affiliate-dash .aff-table td[colspan] { text-align: left; }
  .affiliate-dash .aff-table td[colspan]::before { display: none; }
  .affiliate-dash .aff-withdraw-detail, .affiliate-dash .aff-reference { max-width: none; min-width: 0; }
  .affiliate-dash .aff-withdraw-detail > *, .affiliate-dash .aff-reference > * { min-width: 0; overflow-wrap: anywhere; }
}
