/* PiggyMath embed shell — slim, no site chrome / ads. v=1 */
:root{
  --surface-1:#fcfcfb; --page:#f9f9f7; --ink-1:#0b0b0b; --ink-2:#52514e;
  --muted:#898781; --grid:#e1e0d9; --baseline:#c3c2b7; --border:rgba(11,11,11,0.10);
  --series-1:#2a78d6; --series-2:#eb6834; --series-3:#1baf7a;
  --accent:#2a78d6; --radius:12px;
  --font-body:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-brand:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:16px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:auto;min-height:100%}
body.embed{
  font-family:var(--font-body);background:var(--page);color:var(--ink-1);line-height:1.55;
  padding:12px 14px 16px;
}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.embed-chrome{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid var(--border);
}
.embed-chrome .logo{
  display:inline-flex;align-items:center;gap:8px;
  font-family:var(--font-brand);font-size:1rem;font-weight:700;color:var(--ink-1);letter-spacing:-.02em;
}
.embed-chrome .logo img{width:28px;height:28px}
.embed-chrome .logo span{color:var(--accent)}
.embed-chrome .open-full{
  font-size:.78rem;font-weight:600;color:var(--ink-2);white-space:nowrap;
}
.embed-title{font-size:1.05rem;font-weight:700;letter-spacing:-.01em;margin:0 0 4px}
.embed-lede{font-size:.86rem;color:var(--ink-2);margin:0 0 14px}
.grid{display:grid;grid-template-columns:minmax(240px,1fr) 1fr;gap:14px;align-items:start}
@media(max-width:560px){.grid{grid-template-columns:1fr}}
.card{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:16px}
.card h2{font-size:1rem;margin-bottom:12px}
.field{margin-bottom:12px}
.field:last-child{margin-bottom:0}
.field label{display:block;font-size:.78rem;font-weight:600;color:var(--ink-2);margin-bottom:4px}
.field input,.field select{
  width:100%;padding:9px 11px;border:1px solid var(--baseline);border-radius:8px;
  font-size:.95rem;background:#fff;color:var(--ink-1);
}
.field input:focus,.field select:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.hint{display:block;font-size:.72rem;color:var(--muted);margin-top:4px;line-height:1.35}
.stat-hero{padding:14px 16px;border-radius:var(--radius);background:var(--surface-1);border:1px solid var(--border);margin-bottom:12px}
.stat-hero .label{font-size:.78rem;color:var(--ink-2);font-weight:600}
.stat-hero .value{font-size:1.75rem;font-weight:700;letter-spacing:-.02em;margin-top:2px}
.stat-hero .sub{font-size:.8rem;color:var(--muted);margin-top:2px}
.stat-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:12px}
@media(max-width:420px){.stat-row{grid-template-columns:1fr}}
.stat{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px}
.stat .label{font-size:.7rem;color:var(--ink-2);font-weight:600}
.stat .value{font-size:1.05rem;font-weight:700;margin-top:2px}
.chart-card{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:14px;position:relative}
.chart-card h3{font-size:.88rem;margin-bottom:2px}
.chart-card .chart-sub{font-size:.75rem;color:var(--muted);margin-bottom:8px}
.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:.75rem;color:var(--ink-2);margin-top:6px}
.legend .chip{display:inline-flex;align-items:center;gap:5px}
.legend .swatch{width:9px;height:9px;border-radius:2px;display:inline-block}
.viz-tooltip{position:absolute;pointer-events:none;background:var(--ink-1);color:#fff;font-size:.72rem;padding:5px 8px;border-radius:6px;opacity:0;transition:opacity .1s;white-space:nowrap;z-index:10}
.embed-foot{
  margin-top:14px;padding-top:10px;border-top:1px solid var(--border);
  font-size:.72rem;color:var(--muted);line-height:1.4;
}
.embed-foot a{font-weight:600}
svg text{font-family:inherit}
