.aff-body {
  --bg:#090f1e; --card:#101b2d; --field:#0c1729; --border:#294b70;
  --text:#f2f6ff; --muted:#bccce1; --blue:#60b5ff; --orange:#ff8b47;
  color:var(--text); color-scheme:dark; margin:0; min-height:100vh;
  background:radial-gradient(ellipse at 5% 0,#142e58,transparent 40rem),var(--bg);
  font:15px/1.5 "Instrument Sans",system-ui,sans-serif;
}
.aff-body *, .aff-body *::before, .aff-body *::after { box-sizing:border-box; }
.aff-body [hidden] { display:none !important; }
.aff-header {
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  min-height:64px; padding:8px max(16px,calc((100% - 1240px)/2));
  border-bottom:1px solid #3a6492; background:#0b1528;
}
.aff-header a { display:flex; align-items:center; gap:9px; color:var(--text); text-decoration:none; font-weight:750; }
.aff-header a:last-child { color:#abd4ff; }
.aff-header img { border-radius:8px; border:1px solid var(--border); object-fit:contain; }
.aff-main { width:min(calc(100% - 32px),1240px); margin:auto; padding:28px 0 64px; }
.aff-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:19px; }
.aff-heading h1 { margin:0; font-size:clamp(1.85rem,5vw,3.3rem); letter-spacing:-.045em; line-height:1.08; }
.aff-heading p { color:var(--muted); margin:7px 0 0; }
#affNotice:empty {display:none}
.aff-card,.aff-metrics article {
  min-width:0; padding:17px; background:var(--card);
  border:1px solid var(--border); border-radius:12px;
}
.aff-card h2 { margin:0 0 10px; font-size:1.15rem; }
.aff-card h3 { margin:20px 0 8px; }
.aff-card a { color:#a8d5ff; }
.aff-auth { max-width:460px; }
.aff-auth form,.aff-auth { display:grid; gap:14px; }
.aff-muted,.aff-records small,.aff-product small { color:var(--muted); }
.aff-body button,.aff-body input,.aff-body select {
  min-height:44px; min-width:0; padding:8px 11px; border:1px solid #466a93;
  border-radius:8px; color:inherit; background:var(--field); font:inherit;
}
.aff-body input:not([type=checkbox]),.aff-body select { width:100%; }
.aff-body label { display:grid; gap:5px; color:var(--muted); font-size:.88rem; }
.aff-body .aff-check { display:flex; align-items:center; gap:8px; }
.aff-body input[type=checkbox] { width:18px; min-height:18px; accent-color:var(--blue); }
.aff-body button { cursor:pointer; font-weight:680; }
.aff-body button:hover:not(:disabled) { border-color:var(--blue); }
.aff-body button:disabled { opacity:.55; cursor:default; }
.aff-body .aff-primary { color:#170e09; background:var(--orange); border-color:var(--orange); font-weight:800; }
.aff-body .aff-primary:hover:not(:disabled) { background:#ffa56e; border-color:#ffa56e; }
.aff-body :focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
#affDashboard,.aff-overview { display:grid; gap:14px; }
.aff-share {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:14px;
  border-color:#477fb8; background:linear-gradient(112deg,#172f53,#101b2d 80%);
}
.aff-share label { margin-bottom:4px; }
.aff-share .aff-actions { margin:0; }
.aff-nav { display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--border); padding-bottom:8px; }
.aff-nav a { color:#bddefe; display:grid; align-content:center; min-height:44px; text-decoration:none; border-radius:8px; padding:7px 13px; }
.aff-nav a[aria-current=page] { color:#0b172a; background:var(--blue); font-weight:800; }
.aff-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; }
.aff-metrics article { display:grid; gap:5px; background:linear-gradient(139deg,#183050,#101b2d); }
.aff-metrics article:nth-child(3) { border-color:#bc6d43; }
.aff-metrics article strong { font-size:clamp(1.2rem,2.7vw,2rem); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; line-height:1.15; }
.aff-metrics article:nth-child(3) strong { color:#ffaf7f; }
.aff-metrics article span { color:var(--muted); font-size:.83rem; }
.aff-chart {
  height:140px; display:flex; align-items:end; gap:4px; padding:0 7px;
  background:repeating-linear-gradient(to top,transparent 0,transparent 33px,#304c6b 34px,#304c6b 35px);
  border-bottom:1px solid var(--border);
}
.aff-chart i { display:block; flex:1; min-width:0; border-radius:4px 4px 0 0; background:linear-gradient(#77c6ff,#3083df); }
.aff-actions,.aff-inline { display:flex; align-items:end; flex-wrap:wrap; gap:8px; margin:12px 0; }
.aff-records { display:grid; gap:8px; }
.aff-records article {
  display:flex; justify-content:space-between; flex-wrap:wrap; align-items:center; gap:10px 20px;
  border-top:1px solid var(--border); padding:11px 0 4px;
}
.aff-records article div { display:grid; gap:4px; }
.aff-records strong { overflow-wrap:anywhere; }
.aff-status { width:fit-content; border-radius:5px; padding:2px 7px; font-size:.78rem; color:#c3e3ff; background:#193b63; }
.aff-status[data-state=reversed] { color:#ffcec8; background:#4b2935; }
.aff-status[data-state=approved] { color:#ffd8b8; background:#533528; }
.aff-product-grid { display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(min(100%,188px),1fr)); }
.aff-product { display:grid; gap:5px; min-width:0; padding:13px; border:1px solid var(--border); border-radius:9px; background:var(--field); }
.aff-product strong:nth-of-type(2) { color:#ffaf7f; font-size:1.26rem; }
.aff-product button { margin-top:6px; align-self:end; }
.aff-order-amounts { display:flex; flex-wrap:wrap; gap:8px 18px; margin:0; }
.aff-order-amounts dt { color:var(--muted); font-size:.78rem; }
.aff-order-amounts dd { margin:0; font-weight:750; }
.aff-error { color:#ffbbb1; }
@media(max-width:760px) {
  .aff-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .aff-metrics article:last-child { grid-column:1 / -1; }
  .aff-header { font-size:.82rem; }
  .aff-card,.aff-metrics article { padding:12px; }
  .aff-main { padding-top:18px; }
  .aff-share { grid-template-columns:minmax(0,1fr); }
  .aff-nav a { padding:6px 9px; }
}
