/* Refer & Earn — account page, product-page box and admin pills. Scoped to .wpd-ref*. */
.wpd-ref, .wpd-ref-box { --ref-accent: var(--wpd-ca-primary, #155EEF); --ref-text: #172B4D; --ref-muted: #526581; --ref-border: #E5EAF2; --ref-bg: #F5F8FC; --ref-radius: var(--wpd-ca-radius, 14px); color: var(--ref-text); font-family: inherit; box-sizing: border-box; }
.wpd-ref *, .wpd-ref-box * { box-sizing: border-box; }
.wpd-ref h1, .wpd-ref h2 { font-family: inherit; text-transform: none; letter-spacing: normal; margin: 0; line-height: 1.25; }
.wpd-ref-title { font-size: clamp(24px, 3vw, 30px); font-weight: 800; }
.wpd-ref-lede, .wpd-ref-muted { color: var(--ref-muted); }
.wpd-ref-lede { margin: 6px 0 18px; }
.wpd-ref-muted { font-size: 14px; }
.wpd-ref p { margin: 0 0 10px; }

.wpd-ref-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.wpd-ref-tabs a { flex: none; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--ref-border); background: #fff; color: var(--ref-text); text-decoration: none; font-weight: 600; font-size: 14px; }
.wpd-ref-tabs a.is-active { background: var(--ref-accent); border-color: var(--ref-accent); color: #fff; }

.wpd-ref-stats { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wpd-ref-stats li { background: var(--ref-bg); border: 1px solid var(--ref-border); border-radius: var(--ref-radius); padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.wpd-ref-stats span { font-size: 13px; color: var(--ref-muted); }
.wpd-ref-stats strong { font-size: 22px; line-height: 1.2; white-space: nowrap; }

.wpd-ref-panel { background: #fff; border: 1px solid var(--ref-border); border-radius: var(--ref-radius); padding: 18px; margin: 0 0 16px; }
.wpd-ref-panel h2 { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.wpd-ref-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.wpd-ref-empty { text-align: center; color: var(--ref-muted); padding: 18px 0; }

.wpd-ref-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--ref-border); background: #fff; color: var(--ref-text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; }
.wpd-ref-btn:hover { border-color: var(--ref-accent); color: var(--ref-accent); }
.wpd-ref-btn--primary { background: var(--ref-accent); border-color: var(--ref-accent); color: #fff; }
.wpd-ref-btn--primary:hover { color: #fff; filter: brightness(.92); }
.wpd-ref-btn[disabled] { opacity: .5; cursor: not-allowed; }
.wpd-ref-btn--wa { background: #25D366; border-color: #25D366; color: #08341a; }
.wpd-ref-btn--wa:hover { color: #08341a; filter: brightness(.95); }
.wpd-ref-inline { display: inline-block; margin-left: 10px; }

/* link box (account + product page) */
.wpd-ref-box { border: 1px dashed var(--ref-accent); background: color-mix(in srgb, var(--ref-accent) 5%, #fff); border-radius: var(--ref-radius); padding: 14px; margin: 16px 0; }
.wpd-ref-box--compact { margin: 8px 0 0; padding: 10px; background: #fff; }
.wpd-ref-box--guest { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.wpd-ref-box__earn { margin: 0 0 10px; }
.wpd-ref-box__row { display: flex; flex-wrap: wrap; gap: 8px; }
.wpd-ref-box__row input { flex: 1 1 220px; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--ref-border); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; color: var(--ref-text); }
.wpd-ref-box__row [hidden] { display: none !important; }

/* share list */
.wpd-ref-search input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--ref-border); border-radius: 10px; font: inherit; margin-bottom: 12px; }
.wpd-ref-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wpd-ref-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--ref-border); border-radius: 12px; }
.wpd-ref-item__img { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--ref-bg); display: block; }
.wpd-ref-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wpd-ref-item__body { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }

/* rows (earnings / payouts) */
.wpd-ref-rows { list-style: none; margin: 0 0 10px; padding: 0; }
.wpd-ref-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--ref-border); }
.wpd-ref-rows li:first-child { border-top: 0; }
.wpd-ref-rows__main { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.wpd-ref-rows__amt { font-weight: 700; white-space: nowrap; }
.wpd-ref-pager { display: flex; gap: 12px; align-items: center; justify-content: center; }

.wpd-ref-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.wpd-ref-pill--ok { background: #E3F7EE; color: #0B6B45; }
.wpd-ref-pill--warn { background: #FEF3D7; color: #8A4B06; }
.wpd-ref-pill--info { background: #E3EDFF; color: #0F46B8; }
.wpd-ref-pill--bad { background: #FDE8EA; color: #9B1C2A; }
.wpd-ref-pill--muted { background: #EDF0F5; color: #3C4B62; }

.wpd-ref-balance { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.wpd-ref-balance strong { font-size: 28px; }
.wpd-ref-form { display: grid; gap: 8px; max-width: 460px; }
.wpd-ref-form label { font-weight: 600; font-size: 14px; }
.wpd-ref-form input, .wpd-ref-form select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--ref-border); border-radius: 10px; font: inherit; background: #fff; }
.wpd-ref-form [data-method] { display: grid; gap: 8px; }
.wpd-ref-form [data-method][hidden] { display: none; }

.wpd-ref-flash { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; border: 1px solid; }
.wpd-ref-flash ul { margin: 0; padding-left: 18px; }
.wpd-ref-flash--success { background: #ECFDF3; border-color: #A6E9C8; color: #0B6B45; }
.wpd-ref-flash--error { background: #FEF1F2; border-color: #F6B8BE; color: #9B1C2A; }
.wpd-ref-flash--info { background: #EEF4FF; border-color: #D3E2FF; color: var(--ref-text); }

.wpd-ref-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 100002; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: #172B4D; color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.wpd-ref-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
	.wpd-ref-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.wpd-ref-stats strong { font-size: 18px; }
	.wpd-ref-rows li { grid-template-columns: minmax(0, 1fr) auto; }
	.wpd-ref-rows li .wpd-ref-pill { grid-column: 2; justify-self: end; }
	.wpd-ref-box__row .wpd-ref-btn { flex: 1 1 calc(50% - 8px); }
	.wpd-ref-panel { padding: 14px; }
}
@media (max-width: 359px) { .wpd-ref-stats { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .wpd-ref-toast { transition: none; } }
