/* Growth (/platform): web/platform-growth.js. Platform admins only.
   Shell pieces (.h-chart, .h-table, .h-seg, .h-pill) come from homla-shell.css. */

.gr { max-width: 1180px; min-width: 0; }
.gr[aria-busy="true"] { opacity: .6; transition: opacity var(--dur-1) var(--ease); }
.gr-sub { font-size: var(--fs-12); color: var(--text-2); margin-top: 2px; }
.gr-head { align-items: flex-end; }
.gr-filters { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.gr-company { min-width: 200px; max-width: 280px; height: 32px; }

/* Hero: four numbers, one line each under */
.gr-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-surface); overflow: hidden; margin-bottom: var(--s-8); }
.gr-tile { padding: var(--s-5) var(--s-6); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gr-tile + .gr-tile { border-left: 1px solid var(--line); }
.gr-big { font: 300 var(--fs-36)/1 var(--font-display); letter-spacing: var(--track-display); }
.gr-lbl { font-size: var(--fs-14); color: var(--text); }

/* Sections */
.gr-sec { margin-bottom: var(--s-8); min-width: 0; }
.gr-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.gr-sec__title { font: 500 var(--fs-17)/var(--lh-snug) var(--font-sans); letter-spacing: -.01em; margin: 0; }
.gr-chart-lbl { margin: var(--s-5) 0 var(--s-3); }

/* Usage strip */
.gr-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.gr-strip > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gr-strip b { font: 300 var(--fs-24)/1.1 var(--font-display); letter-spacing: var(--track-display); color: var(--text); }
.gr-strip span { font-size: var(--fs-13); color: var(--text-2); }

/* Tables */
.gr-table td { vertical-align: top; }
.gr-table tr.is-stalled td { background: color-mix(in srgb, var(--warn-tint) 45%, transparent); }
.gr-name, .gr-mail { overflow-wrap: anywhere; }
.gr-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.gr-step { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px 0 5px; border-radius: var(--r-pill); font-size: var(--fs-12); color: var(--text-2); background: var(--bg-sunken); white-space: nowrap; }
.gr-step .h-i { width: 12px; height: 12px; }
.gr-step.is-on { background: var(--ok-tint); color: var(--ok); }
.gr-flag .h-i { width: 12px; height: 12px; }

/* Loading */
.gr-skel { display: grid; gap: var(--s-4); }
.gr-skel i { display: block; height: 120px; border-radius: var(--r-lg); background: var(--bg-sunken); }

.gr-foot { border-top: 1px solid var(--line); padding-top: var(--s-4); }
.gr-foot ul { margin: var(--s-2) 0 var(--s-3); padding-left: 18px; }
.gr-foot p { margin: 0 0 var(--s-2); }

@media (max-width: 960px) {
  .gr-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-tile:nth-child(3) { border-left: 0; }
  .gr-tile:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Phone: every table row becomes a card, label on the left */
@media (max-width: 640px) {
  .gr-filters, .gr-company { width: 100%; max-width: none; }
  .gr-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gr-tile { padding: var(--s-4); }
  .gr-big { font-size: var(--fs-24); }
  .gr-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gr-wrap { border: 0; background: transparent; overflow: visible; }
  .gr-table thead { display: none; }
  .gr-table, .gr-table tbody, .gr-table tr { display: block; width: 100%; }
  .gr-table tr { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-surface); margin-bottom: var(--s-3); padding: var(--s-2) 0; overflow: hidden; }
  .gr-table td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-3); border-bottom: 0; padding: 6px var(--s-4); }
  .gr-table td::before { content: attr(data-label); font: 500 var(--fs-11)/1.6 var(--font-mono); letter-spacing: var(--track-mono); text-transform: uppercase; color: var(--text-2); }
  .gr .h-chart__x:not(.gr-x-grid) span:nth-child(2), .gr .h-chart__x:not(.gr-x-grid) span:nth-child(4) { display: none; }
  .gr .gr-x-grid { font-size: 9px; }
}

/* Thin bars at every period; a short series labels every day under its own bar */
.gr .h-chart__bar { width: 100%; max-width: 28px; justify-self: center; }
.gr .h-chart__x.gr-x-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; text-align: center; }
