/* learnmingo.com - the desk: stats page styles (on top of /desk/desk.css; DESK.md). Growth, Visits, World and Words are built
   from the kit's components (cards, tiles, charts, share rows, tables), so this sheet holds only what is theirs: the page bar
   (a filter or a stamp above everything it scopes), the funnel's,
   the retention grid's and the world table's column rails, and the Chinese of a word row. Colours and states come from
   desk.css. */

/* the page bar: the control that scopes the whole page (Visits' window) or the stamp of its read (Words) */
.st-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; min-height: 32px; margin: 0 0 14px; }
.st-bar-end { justify-content: flex-end; }
/* a read under way: what is shown stays, a step quieter (no skeleton, nothing moves) */
.st-wait { opacity: .55; }

/* charts that share a card stack on one x axis */
.st-stack > * + * { margin-top: 16px; }
.st-under { margin-top: 18px; }

/* the funnel: step · bar · number · share of the sign-ups */
.st-funnel {
  --cols: minmax(0, 1.1fr) minmax(56px, 1fr) var(--rail-num) var(--rail-span);
  --cols-phone: minmax(0, 1fr) var(--rail-count) var(--rail-num);
}

/* retention by sign-up week: the week · its accounts · one cell per week after sign-up (nine: growth.js COHORT_WEEKS).
   One hue: a cell's fill deepens with its share (--v, 0 … 1; the dark mode's step of the hue brightens instead), and stops
   where the figure, always in ink, still clears 4.5:1 on it. A share of nothing is a neutral plate; a week that has not begun
   is an empty cell. Cells are 2px apart, so each reads as its own mark. */
.st-cohort { --cols: 84px 72px repeat(9, minmax(0, 1fr)); --cols-phone: 46px 30px repeat(9, minmax(0, 1fr)); }
.st-cohort .dk-th, .st-cohort .dk-tr { column-gap: 2px; }
.st-cohort .dk-th > :nth-child(2), .st-cohort .dk-tr > :nth-child(2) { padding-right: 12px; }
.st-cohort .dk-tr { min-height: 30px; padding: 0; align-items: stretch; }
.st-cohort .dk-tr > .dk-c { align-self: center; white-space: nowrap; }
.st-co-b { display: grid; row-gap: 2px; padding-top: 8px; }
.st-co-h { text-align: center; }
.st-co-c {
  display: flex; align-items: center; justify-content: center; min-width: 0; border-radius: 4px;
  font: 500 12px var(--w-mono); font-variant-numeric: tabular-nums; color: var(--w-ink);
}
.st-co-c.is-on { background: color-mix(in srgb, var(--dk-s1) calc(8% + var(--v) * 46%), transparent); }
.st-co-c.is-zero { background: color-mix(in srgb, var(--w-ink) 5%, transparent); color: var(--w-ink-2); }
.st-co-none > .dk-c { color: var(--w-ink-2); }

/* the world table (radialtimers' .wt): rank · country · share bar · visits · visitors · accounts. The bar rides the inked
   column, whose figures are in ink; the unknown-country row is last, unranked and muted. */
.st-world {
  --cols: var(--rail-rank) minmax(0, 1.2fr) minmax(70px, 1fr) var(--rail-num) var(--rail-num) var(--rail-num);
  --cols-phone: var(--rail-rank) minmax(0, 1fr) 50px 56px 60px;
}
.st-world .dk-flag { font-size: inherit; color: var(--w-ink); }
/* the World page's cities (2026-11-16): rank · flag + city, region · share bar · visitors · accounts */
.st-cities {
  --cols: var(--rail-rank) minmax(0, 1.2fr) minmax(70px, 1fr) var(--rail-num) var(--rail-num);
  --cols-phone: var(--rail-rank) minmax(0, 1fr) 56px 60px;
}
.st-cities .dk-flag { font-size: inherit; color: var(--w-ink); }
:is(.st-world, .st-cities) .dk-flag-g { font-size: 14px; }
:is(.st-world, .st-cities) .dk-num[data-on] { color: var(--w-ink); }
:is(.st-world, .st-cities) .st-rest .dk-flag { color: var(--w-ink-2); }
:is(.st-world, .st-cities) .st-rest .dk-bar i { background: color-mix(in srgb, var(--dk-s1) 45%, transparent); }

/* a word row: the Chinese in the site's Chinese face, a step larger than the row */
.st-zh { font-family: var(--w-zh); font-size: 15px; line-height: 1.3; white-space: nowrap; }

@media (max-width: 620px) {
  .st-funnel .dk-tr > :first-child { white-space: normal; }
  .st-cohort .dk-th > :nth-child(2), .st-cohort .dk-tr > :nth-child(2) { padding-right: 6px; }
  .st-co-c { font-size: 10.5px; }
  /* the kit's share rows on these pages: the label gets the room and wraps where it still does not fit (a device or a
     source reads whole), and the count rail seats its head (Accounts) */
  :is(#pg-growth, #pg-visits, #pg-words) .dk-share { --cols: minmax(0, 2.2fr) minmax(32px, 1fr) 60px 44px; }
  :is(#pg-growth, #pg-visits, #pg-words) .dk-share .dk-tr > .dk-cut { white-space: normal; overflow-wrap: anywhere; }
  /* the world row keeps its bar: the figures stay on the first line, the bar runs under them from the country's edge */
  :is(.st-world, .st-cities) .dk-th > .st-nobar { display: none; }
  :is(.st-world, .st-cities) .dk-tr { row-gap: 5px; padding: 8px 0 9px; }
  /* a long country name wraps instead of being cut (the figures keep their rails) */
  :is(.st-world, .st-cities) .dk-tr > .dk-cut, :is(.st-world, .st-cities) .dk-flag { white-space: normal; overflow: visible; }
  :is(.st-world, .st-cities) .dk-tr > .dk-bar { grid-column: 2 / -1; grid-row: 2; height: 4px; }
}
