/* sizes-chart.css — app size history charts.
 *
 * Pairs with assets/sizes-chart.js. Everything is scoped under .szc so this can
 * drop into the middle of pumaworx.html / security.html without touching their
 * styles, and it is built on the tokens BOTH suite pages already define
 * (--bg-1, --border, --text-*, --accent, --font-*). That is deliberate: the
 * section then inherits each page's identity for free — teal on PumaWorx, red
 * on Security — with no per-page stylesheet.
 *
 * Fallbacks are supplied on every var() so the file also works on a bare page
 * that defines none of them.
 *
 * HOST REQUIREMENT: give the containing section its own opaque background. The
 * suite pages paint a fixed body::before glow behind everything, and a section
 * that sets no background lets it through — which reads as an ugly clipped
 * shine in that band's lower-left corner while every neighbouring section looks
 * clean. Prefer the page's --bg-0: the panels below are --bg-1, so a --bg-1
 * section would flatten them into their own background. Give the mount a top
 * margin too — the component has no idea a heading sits above it, so without
 * one the panels butt straight against the section copy.
 */

.szc {
  --szc-bg:     var(--bg-1, #161b2c);
  --szc-line:   var(--border, rgba(255,255,255,.07));
  --szc-line-2: var(--border-mid, rgba(255,255,255,.12));
  --szc-ink:    var(--text, #f3f5fa);
  --szc-mid:    var(--text-mid, rgba(243,245,250,.72));
  --szc-low:    var(--text-low, rgba(243,245,250,.48));
  --szc-dim:    var(--text-dim, rgba(243,245,250,.32));
  --szc-accent: var(--accent, #4ab8d4);
  --szc-sans:   var(--font-sans, 'Inter', system-ui, -apple-system, sans-serif);
  --szc-mono:   var(--font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace);
  /* Recessive chart chrome — one shade off the surface, solid hairlines. */
  --szc-grid:   rgba(255,255,255,.06);
  --szc-axis:   rgba(255,255,255,.10);
  font-family: var(--szc-sans);
  color: var(--szc-ink);
}
.szc *, .szc *::before, .szc *::after { box-sizing: border-box; }
.szc [hidden] { display: none !important; }

/* ─── tiles ─────────────────────────────────────────────── */
.szc-tiles {
  display: grid; gap: 14px; margin-bottom: 26px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.szc-tile {
  background: var(--szc-bg); border: 1px solid var(--szc-line);
  border-radius: 12px; padding: 16px 18px;
}
.szc-tile-l {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--szc-low); margin-bottom: 6px;
}
/* Proportional figures — tabular-nums makes large standalone numbers read loose. */
.szc-tile-v { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.szc-tile-s { font-size: .78rem; color: var(--szc-dim); margin-top: 3px; }

/* ─── controls ──────────────────────────────────────────── */
.szc-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--szc-line);
}
.szc-controls .szc-sp { flex: 1; }
.szc-lab { font-size: .78rem; color: var(--szc-dim); letter-spacing: .04em; }
.szc-seg {
  display: inline-flex; background: var(--szc-bg);
  border: 1px solid var(--szc-line); border-radius: 9px; padding: 3px;
}
.szc-seg button {
  font: inherit; font-size: .82rem; color: var(--szc-low); background: none;
  border: 0; cursor: pointer; padding: 6px 13px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.szc-seg button:hover:not(:disabled) { color: var(--szc-ink); }
.szc-seg button[aria-pressed="true"] { background: var(--bg-2, #1c2235); color: var(--szc-ink); }
.szc-seg button:disabled { cursor: default; }
.szc-ghost {
  font: inherit; font-size: .82rem; color: var(--szc-low); cursor: pointer;
  background: var(--szc-bg); border: 1px solid var(--szc-line);
  border-radius: 9px; padding: 8px 14px; transition: color .15s, border-color .15s;
}
.szc-ghost:hover { color: var(--szc-ink); border-color: var(--szc-line-2); }
.szc-seg button:focus-visible, .szc-ghost:focus-visible {
  outline: 2px solid var(--szc-accent); outline-offset: 2px;
}

/* ─── small multiples ───────────────────────────────────── */
.szc-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}
.szc-panel {
  background: var(--szc-bg); border: 1px solid var(--szc-line);
  border-radius: 12px; padding: 15px 16px 10px; transition: border-color .15s;
}
.szc-panel:hover { border-color: var(--szc-line-2); }
.szc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.szc-name {
  font-size: .88rem; font-weight: 600; letter-spacing: -.01em;
  text-decoration: none; color: inherit; display: flex; align-items: center; gap: 7px;
}
.szc-name:hover .szc-nm { text-decoration: underline; }
/* The swatch repeats the line colour beside a text name, so identity is never
   carried by colour alone. */
.szc-sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.szc-now {
  margin-left: auto; font-family: var(--szc-mono); font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.szc-meta {
  font-size: .72rem; color: var(--szc-dim); margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.szc-meta .szc-live { color: var(--szc-accent); }

.szc-chart { width: 100%; display: block; overflow: visible; }
.szc-chart .szc-gl   { stroke: var(--szc-grid); stroke-width: 1; }
.szc-chart .szc-ax   { stroke: var(--szc-axis); stroke-width: 1; }
.szc-chart .szc-tick {
  font-family: var(--szc-mono); font-size: 9px; fill: var(--szc-dim);
  font-variant-numeric: tabular-nums;
}
.szc-chart .szc-ln {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
}
.szc-chart .szc-cur { stroke: var(--szc-line-2); stroke-width: 1; }
/* 2px surface ring keeps the endpoint legible where it overlaps the line. */
.szc-chart .szc-cap { stroke: var(--szc-bg); stroke-width: 2; }

/* ─── tooltip ───────────────────────────────────────────── */
.szc-tip {
  position: fixed; z-index: 200; pointer-events: none; opacity: 0;
  transition: opacity .1s; background: var(--bg-2, #1c2235);
  border: 1px solid var(--szc-line-2); border-radius: 8px; padding: 8px 11px;
  font-family: var(--szc-sans); font-size: .78rem; line-height: 1.45;
  color: var(--szc-ink); box-shadow: 0 8px 24px rgba(0,0,0,.5); white-space: nowrap;
}
.szc-tip .szc-t1 { font-family: var(--szc-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.szc-tip .szc-t2 { color: var(--szc-low); font-family: var(--szc-mono); font-size: .72rem; font-variant-numeric: tabular-nums; }
.szc-tip .szc-t3 { font-family: var(--szc-mono); font-size: .72rem; font-variant-numeric: tabular-nums; }

/* ─── table view ────────────────────────────────────────── */
.szc-tablewrap {
  overflow-x: auto; border: 1px solid var(--szc-line);
  border-radius: 12px; background: var(--szc-bg);
}
.szc-tablewrap table { border-collapse: collapse; width: 100%; font-size: .84rem; }
.szc-tablewrap th, .szc-tablewrap td { padding: 10px 14px; text-align: left; white-space: nowrap; }
.szc-tablewrap th {
  font-size: .72rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--szc-low); font-weight: 600; border-bottom: 1px solid var(--szc-line-2);
}
.szc-tablewrap td { border-bottom: 1px solid var(--szc-line); color: var(--szc-mid); }
.szc-tablewrap tbody tr:last-child td { border-bottom: 0; }
.szc-tablewrap td.szc-num { text-align: right; font-family: var(--szc-mono); font-variant-numeric: tabular-nums; color: var(--szc-ink); }
.szc-tablewrap td a { color: inherit; }
.szc-appcell { display: flex; align-items: center; gap: 8px; }

/* ─── notes ─────────────────────────────────────────────── */
.szc-note { color: var(--szc-dim); font-size: .8rem; margin-top: 20px; max-width: 74ch; line-height: 1.6; }
.szc-note code { font-family: var(--szc-mono); font-size: .9em; }
.szc-note a { color: var(--szc-accent); }
.szc-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .szc *, .szc *::before, .szc *::after { transition-duration: .001ms !important; }
}
