/* Post extras: Expand button on diagrams, full-screen view, stat card and bar chart components.
   Split out of style.css on 2026-11-23 (file-size limit). Loaded on single posts after style.css. */
/* Expand button on post diagrams + full-screen view */
.prose figure.has-expand{position:relative}
.expand-btn{position:absolute;top:12px;right:12px;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.92);color:var(--ink2);font:500 14px var(--sans);cursor:pointer;opacity:.85;z-index:2}
.expand-btn:hover,.expand-btn:focus-visible{opacity:1;border-color:var(--ink)}
.expand-btn svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lb{position:fixed;inset:0;z-index:1000;background:rgba(13,17,23,.88);display:flex;align-items:center;justify-content:center;padding:4vh 3vw;cursor:zoom-out}
.lb img{max-width:100%;max-height:100%;width:auto;height:auto;border-radius:12px;background:#fff;cursor:default;box-shadow:0 10px 40px rgba(0,0,0,.4)}
.lb-close{position:fixed;top:14px;right:18px;width:42px;height:42px;border-radius:50%;border:0;background:#fff;color:#111;font-size:26px;line-height:42px;cursor:pointer}
html.lb-open{overflow:hidden}
@media (max-width:640px){.expand-btn span{display:none}.expand-btn{padding:6px 8px;top:8px;right:8px}.lb{padding:2vh 2vw;overflow:auto;justify-content:flex-start;align-items:center}.lb img{max-width:none;max-height:none;width:auto;height:min(70vh,560px)}}

/* Rich post components (2026-11-23): stat card and before/after bar chart. Plain HTML in post content; each has a PNG twin for Medium/dev.to. */
.prose .tm-stat{margin:28px 0;background:#fff;border:1px solid var(--line);border-radius:22px;padding:22px 24px}
.tm-stat-num{display:flex;align-items:baseline;gap:12px;font:700 clamp(30px,5vw,44px)/1.1 var(--sans);color:var(--ink);letter-spacing:-.01em}
.tm-stat-num .arr{color:#1a7f37;font-weight:700}
.tm-stat-num .from{color:var(--muted);font-weight:600}
.tm-stat-label{margin:6px 0 16px;color:var(--ink2);font-size:17px}
.tm-stat-bar{height:10px;border-radius:99px;background:var(--line2);overflow:hidden}
.tm-stat-bar span{display:block;height:100%;background:#1a7f37;border-radius:99px}
.tm-stat-ends{display:flex;justify-content:space-between;margin-top:6px;font:12px var(--mono);color:var(--muted)}
.prose .tm-source{margin:-14px 0 28px;text-align:center;font-size:14px;color:var(--muted);font-style:italic}
.prose .tm-chart{margin:28px 0;background:#fff;border:1px solid var(--line);border-radius:22px;padding:20px 24px 16px}
.tm-chart-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.tm-chart-title{font-weight:600;color:var(--ink);font-size:17px}
.tm-legend{display:flex;gap:14px;font-size:13px;color:var(--muted)}
.tm-legend i{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.tm-row{display:grid;grid-template-columns:150px 1fr;gap:6px 14px;align-items:center;margin:10px 0}
.tm-row-label{font-size:15px;color:var(--ink2)}
.tm-bars{display:flex;flex-direction:column;gap:5px}
.tm-bar{display:flex;align-items:center;gap:8px;font:12px var(--mono);color:var(--muted)}
.tm-bar b{display:block;height:14px;border-radius:4px;min-width:3px}
.tm-bar .before{background:#9aa5b4}.tm-bar .after{background:#1a7f37}
.tm-legend .before{background:#9aa5b4}.tm-legend .after{background:#1a7f37}
@media (max-width:640px){.tm-row{grid-template-columns:1fr}.prose .tm-chart,.prose .tm-stat{padding:16px}}
