/* «🤝 Реферальная программа» of an owner's site (web/owner-site-referral.js). */
.oref { display: grid; gap: var(--space-grid); }
.oref .card h2 { margin: 0 0 6px; }
.oref-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.oref-hero-top p { margin: 0; max-width: 62ch; }
.oref-switch { display: inline-flex; align-items: center; gap: 10px; flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); }
.oref-switch span[id] { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.oref-switch .oref-is-on { color: var(--ok); }
.oref-notice { margin-top: 16px; padding: 14px 16px; border: 1px solid rgb(228 174 79 / .35); border-radius: var(--radius-md); background: rgb(228 174 79 / .08); }
.oref-notice p { margin: 0 0 6px; }
.oref-notice p:first-child { color: var(--warn); font-weight: 600; }
.oref-wait { margin: 14px 0 0; }
.oref-why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.oref-why li { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); }
.oref-why li > span { font-size: 22px; line-height: 1.2; }
.oref-why p { margin: 4px 0 0; font-size: 14px; }

.oref-range { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.oref-range input[type="range"] { flex: 1; min-width: 0; accent-color: var(--ok); height: 28px; }
.oref-value { min-width: 4ch; font: 600 22px/1 var(--font-display); color: var(--text); text-align: right; }
.oref-scale { display: flex; justify-content: space-between; margin: 2px 0 0; font-size: 12px; }
.oref-example { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 6px; }
.oref-example > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); }
.oref-example small { color: var(--muted); font-size: 12px; }
.oref-example strong { font: 600 20px/1.2 var(--font-display); }
.oref-example .oref-example-to { border-color: rgb(90 196 143 / .45); background: rgb(90 196 143 / .08); }
.oref-example .oref-example-to strong { color: var(--ok); }
.oref-rules { margin-top: 16px; }
.oref-rules summary { cursor: pointer; font-weight: 600; }
.oref-rules ul { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); }
.oref-rules li + li { margin-top: 6px; }

.oref-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0; padding: 0; list-style: none; counter-reset: oref; }
.oref-steps li { position: relative; padding: 14px 14px 14px 52px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); counter-increment: oref; }
.oref-steps li::before { content: counter(oref); position: absolute; top: 14px; left: 14px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: 14px; }
.oref-steps p { margin: 4px 0 0; font-size: 14px; }

.oref-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.oref-kpi { display: grid; gap: 2px; padding: 12px 14px; }
.oref-kpi small { color: var(--muted); font-size: 12px; }
.oref-kpi strong { font: 600 22px/1.2 var(--font-display); }
.oref-stats > p { margin: 12px 0 0; }

@media (max-width: 899px) {
  .oref-why, .oref-steps { grid-template-columns: 1fr; }
  .oref-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .oref-hero-top { flex-direction: column; }
  .oref-switch { align-self: stretch; justify-content: space-between; }
  .oref-example { grid-template-columns: 1fr 1fr; }
  .oref-example > div:first-child { grid-column: 1 / -1; }
  .oref-example strong, .oref-value { font-size: 18px; }
}

/* «Аналитика программы» (web/owner-site-referral-stats.js): the period, five figures, the chart, the best referrers. */
.oref-an { --sins-accent: 90 196 143; display: grid; gap: 14px; }
.oref-an-head { display: grid; gap: 12px; }
.oref-an-head p { margin: 0; max-width: 70ch; }
.oref-periods { display: flex; flex-wrap: wrap; max-width: 100%; }
.oref-periods button, .oref-metrics button { flex: none; white-space: nowrap; }
[data-oref-an] { display: grid; gap: 14px; min-width: 0; }
[data-oref-an] > p { margin: 0; }
.oref-kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 0; }
/* Every tile's figure on the same line, whether or not a hint follows it. */
.oref-kpis-5 .oref-kpi { align-content: start; }
.oref-kpi.is-money { border-color: rgb(90 196 143 / .45); background: rgb(90 196 143 / .08); }
.oref-kpi.is-money strong { color: var(--ok); }
.oref-since { font-size: 13px; }
.oref-chart { display: grid; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); }
.oref-chart > p { margin: 0; }
.oref-chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.oref-metrics { flex-wrap: wrap; max-width: 100%; }
.oref-chart-head h3, .oref-top h3 { margin: 0; font-size: 15px; }
.oref-top { display: grid; gap: 8px; }
.oref-top > p { margin: 0; }
.oref-top-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.oref-top-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); }
.oref-rank { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; font-weight: 700; font-size: 13px; }
.oref-top-list li:first-child .oref-rank { border-color: transparent; background: var(--primary); color: var(--primary-ink); }
.oref-who { display: grid; gap: 1px; min-width: 0; }
.oref-who small { font-size: 12px; }
.oref-top-figs { display: grid; grid-template-columns: repeat(4, minmax(64px, auto)); gap: 4px 16px; text-align: right; }
.oref-top-figs div { display: grid; }
.oref-top-figs small { color: var(--muted); font-size: 11px; }
.oref-top-figs b { font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .oref-kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oref-kpis-5 .is-money { order: -1; grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .oref-periods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .oref-periods button { padding: 0 6px; }
  .oref-top-list li { grid-template-columns: auto minmax(0, 1fr); }
  .oref-top-figs { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; text-align: left; }
  /* One line per label, the figures in a row below them. */
  .oref-top-figs small { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
  /* The chart's four figures two by two: the switch never wider than the card. */
  .oref-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .oref-metrics button { padding: 0 6px; }
}
