/* «Haradan gəlirlər» (spec docs/sources-tech.md): four numbers; the steps of a visit as bars shrinking from the visits
   that opened the page; the day's hours as small columns; the sources each with its colour and its share; the links to
   share, each with its QR. Bars sized by CSS properties set from the script (--w, --h, --c). */
.src-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.src-head__text { min-width: 0; }
.src-head__title { font: var(--display-weight) 22px/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.src-head__text .muted { margin-top: 4px; max-width: 64ch; font-size: 14px; }
.src-period button { min-width: 72px; }
.src-kpis { margin-bottom: 14px; }

.src-two { display: grid; gap: 12px; margin-bottom: 12px; }
@media (min-width: 900px) { .src-two { grid-template-columns: 1.2fr 1fr; } }
.src-card { padding: 16px 18px; min-width: 0; }
.src-card + .src-card { margin-top: 12px; }
.src-two .src-card + .src-card { margin-top: 0; }
.src-card__title { margin-bottom: 12px; }
.src-note { margin-top: 10px; font-size: 13px; }
.src-note--top { margin: -4px 0 12px; }

/* the steps */
.src-funnel { display: grid; gap: 10px; padding: 0; list-style: none; }
.src-step { display: grid; grid-template-columns: minmax(96px, 30%) 1fr auto 46px; align-items: center; gap: 10px; }
.src-step__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.src-step__bar { position: relative; height: 26px; border-radius: 8px; background: var(--surface); overflow: hidden; }
.src-step__bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--w, 0) * 1%); border-radius: 8px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff)); transition: width .4s var(--ease, ease); }
.src-step:last-child .src-step__bar i { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #fff)); }
.src-step__n { font-size: 15px; font-weight: 700; color: var(--ink); text-align: right; }
.src-step__pct { font-size: 12px; color: var(--ink-2); text-align: right; }

/* the hours */
.src-hours { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 3px; height: 120px; }
.src-hours i { display: block; height: calc(var(--h, 0) * 100%); min-height: 2px; border-radius: 4px 4px 1px 1px;
  background: color-mix(in srgb, var(--accent) 75%, transparent); }
.src-hours__axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-3); }

/* the sources */
.src-table { display: grid; }
.src-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 8px; padding: 10px 0;
  border-top: 1px solid var(--line); font-size: 14px; }
.src-row > span:not(:first-child) { text-align: right; }
.src-row--head { border-top: 0; padding-top: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.src-row__name { display: grid; grid-template-columns: 12px 1fr; align-items: center; gap: 4px 8px; min-width: 0; }
.src-row__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row__share { grid-column: 2; height: 4px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.src-row__share i { display: block; height: 100%; width: calc(var(--w, 0) * 1%); background: var(--c, var(--accent)); }
/* where the browser lets the rows share one grid, the numbers take their own width (on a wide screen at least
   80px each) and a name keeps the rest — a phone showed «Instagra…» */
@supports (grid-template-columns: subgrid) {
  .src-table { grid-template-columns: minmax(0, 1fr) repeat(4, minmax(80px, auto)); column-gap: 14px; }
  .src-table > [data-part="rows"] { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
  .src-row { grid-column: 1 / -1; grid-template-columns: subgrid; }
  @media (max-width: 640px) { .src-table { grid-template-columns: minmax(0, 1fr) repeat(4, auto); column-gap: 10px; } }
}
.src-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }

/* the links */
.src-links { display: grid; gap: 8px; padding: 0; list-style: none; }
.src-link { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm, 10px); }
.src-link__text { display: grid; gap: 2px; min-width: 0; }
.src-link__text b { font-size: 14px; }
.src-link__text small { font-size: 12px; }
.src-link__url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--accent-text, var(--accent)); }
@media (max-width: 640px) {
  .src-link { gap: 6px 8px; padding: 10px; }
  .src-link [data-action="copy"] span { display: none; }
  .src-row { font-size: 13px; }
  .src-step { grid-template-columns: 84px 1fr auto 40px; }
}
.src-qr { display: grid; justify-items: center; gap: 12px; text-align: center; }
.src-qr__code svg { width: min(280px, 70vw); height: auto; }
@media (prefers-reduced-motion: reduce) { .src-step__bar i { transition: none; } }
