/* Yolt v11 — Scorecard SPARK · CANONICAL version per Yolt PNG approval (Group 1)
 * Locked: 2026-05-10 (round 2 — fix drift from Batch 4a)
 *
 * Layout per approved curation:
 *   - Header row: label + ?-help-icon LEFT · "Реальний" tag RIGHT
 *   - Body: big value LEFT · large inline sparkline RIGHT (not overlay)
 *   - Tag row: 3-column РЕАЛЬНИЙ / ОЧІКУВАНИЙ / ЗАГАЛЬНИЙ з values
 *     · РЕАЛЬНИЙ value tinted color (good=green, info=cyan)
 *   - Footer: ▼/▲ delta · "vs прев. 30д"
 *
 * Variants:
 *   .ssp-card                       — default, з inline sparkline
 *   .ssp-card.is-selected           — green outline (focus/active state)
 *   .ssp-card.is-spend              — no sparkline; small horizontal bar instead;
 *                                     3-tag = Google/Meta/ROAS · footer "■ — vs прев. 30д"
 *
 * data-tone is ORTHOGONAL — applies value color (revenue green / expense red)
 * but spark visual is the canonical inline-right pattern.
 */

.ssp-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md, 12px);
}
.ssp-row.cols-3 { grid-template-columns: repeat(3, 1fr); }

.ssp-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex; flex-direction: column;
  gap: 10px;
  position: relative;
}
.ssp-card.is-selected {
  border-color: color-mix(in oklch, var(--good) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--good) 22%, transparent);
}
.ssp-card.is-bad-state {
  border-color: color-mix(in oklch, var(--bad) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--bad) 22%, transparent);
}

/* Header row */
.ssp-card .ssp-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.ssp-card .ssp-h .ssp-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--ink-1);
  letter-spacing: -0.005em;
}
.ssp-card .ssp-h .ssp-q {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2); color: var(--ink-3);
  font-size: 10px; display: grid; place-items: center;
  cursor: help;
}
.ssp-card .ssp-real-tag {
  font-size: 11px; padding: 3px 10px; border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--ink-3); font-weight: 500;
  background: var(--bg-2);
}
.ssp-card.is-selected .ssp-real-tag {
  color: var(--good);
  border-color: color-mix(in oklch, var(--good) 35%, var(--line));
}

/* Big value + inline sparkline RIGHT */
.ssp-body {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 16px; min-height: 56px;
}
.ssp-card .ssp-v {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-0);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ssp-card[data-tone="revenue"] .ssp-v { color: var(--good); }
.ssp-card[data-tone="expense"] .ssp-v { color: var(--bad); }

.ssp-spark {
  width: 140px; height: 42px;
  flex: none;
}
.ssp-spark svg { display: block; width: 100%; height: 100%; }

/* Spend variant: no sparkline, just thin colored bar after value */
.ssp-card.is-spend .ssp-body { grid-template-columns: auto auto; justify-content: start; }
.ssp-card.is-spend .ssp-bar {
  width: 140px; height: 3px;
  background: color-mix(in oklch, var(--bad) 70%, transparent);
  border-radius: 2px; align-self: end;
  margin-bottom: 6px;
}

/* Tag row · 3 columns */
.ssp-tags {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.ssp-tags .ssp-tag { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ssp-tags .ssp-tag .tt {
  font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
}
.ssp-tags .ssp-tag .tv {
  font-size: 14px; color: var(--ink-1); font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* РЕАЛЬНИЙ tag highlighted color */
.ssp-tags .ssp-tag.is-real .tv { color: var(--info); }
.ssp-card[data-tone="revenue"] .ssp-tags .ssp-tag.is-real .tv { color: var(--good); }
.ssp-card[data-tone="expense"] .ssp-tags .ssp-tag.is-real .tv { color: var(--bad); }

/* Footer · delta + period suffix */
.ssp-foot {
  font-size: 12.5px;
  color: var(--bad);
  font-variant-numeric: tabular-nums;
}
.ssp-foot.good { color: var(--good); }
.ssp-foot.flat { color: var(--ink-3); }
.ssp-foot .arr { display: inline-block; margin-right: 4px; }
.ssp-foot .suf { color: var(--ink-3); font-weight: 400; margin-left: 4px; }
