/* Blog reading surface — consumes site-tokens.css (load it first).
   Light-first with automatic graphite dark; every color and size
   here comes from a token so the page holds in both themes. */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1060px; margin: 0 auto; padding: 48px 20px 100px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1000px) { .shell { grid-template-columns: 200px minmax(0, var(--measure)); } }
.article { max-width: var(--measure); }

.toc { display: none; }
@media (min-width: 1000px) {
  .toc { display: block; position: sticky; top: 32px; align-self: start; font-size: var(--fs-caption); }
  .toc .t { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: var(--fs-label); font-weight: 700; margin-bottom: 10px; }
  .toc a { display: block; color: var(--muted); text-decoration: none; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); line-height: 1.4; transition: color 150ms, border-color 150ms; }
  .toc a:hover { color: var(--text); border-left-color: var(--blue); }
}

.nav-back { display: inline-flex; align-items: center; margin-bottom: 36px; color: var(--blue); text-decoration: none; font-size: var(--fs-secondary); font-weight: 500; }
.nav-back:hover { text-decoration: underline; }
.article-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: var(--fs-secondary); margin-bottom: 14px; }
.category { background: color-mix(in srgb, var(--bubble-blue) 15%, transparent); color: var(--blue); padding: 3px 12px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-caption); }

h1 { font-size: var(--fs-hero); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 26px; font-weight: 800; text-wrap: balance; }
h2 { font-size: var(--fs-title); letter-spacing: -0.01em; margin: 44px 0 12px; font-weight: 700; scroll-margin-top: 24px; text-wrap: balance; }
h3 { font-size: var(--fs-heading); margin: 26px 0 8px; font-weight: 650; }
p { margin-bottom: 14px; }
a { color: var(--blue); }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
strong { color: var(--strong); }
ol, ul { margin: 0 0 16px 22px; }
li { margin-bottom: 8px; }

.fig { margin: 20px 0 26px; }
.fig-tight { margin: 6px 0 14px; }

.bluf { background: var(--panel-top); box-shadow: var(--card-shadow); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--r-card); padding: 18px 20px; margin: 22px 0 8px; }
.bluf .k { color: var(--amber); background: var(--chip-amber-bg); padding: 2px 8px; border-radius: 6px; display: inline-block; font-size: var(--fs-label); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; }
.bluf p { margin: 0; }
.bluf ul { margin: 0; padding-left: 18px; }
.bluf li { margin-bottom: 6px; }
.bluf li:last-child { margin-bottom: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 22px; }
.stat { background: linear-gradient(180deg, var(--panel-top), var(--panel-bot)); box-shadow: var(--card-shadow); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 14px 16px 11px; }
.stat .n { font-size: var(--fs-title); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--amber-hi); }
.stat .l { color: var(--muted); font-size: var(--fs-caption); margin-top: 2px; line-height: 1.35; }

.sms-thread { background: var(--bubble-thread); border: 1px solid var(--line); border-radius: var(--r-thread); box-shadow: var(--card-shadow); padding: 18px 16px 8px; margin: 18px 0 22px; }
.sms-thread .who { color: var(--muted); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; margin: 0 0 10px 4px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; margin-bottom: 10px; font-size: var(--fs-secondary); line-height: 1.45; }
.bubble.sent { background: var(--bubble-blue); color: #fff; margin-left: auto; border-bottom-right-radius: 5px; }
.bubble.bad { background: var(--bubble-recv); border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); color: var(--text); border-bottom-left-radius: 5px; }
.bubble .tag { display: block; font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 3px; opacity: 0.75; }
.bubble.bad .tag { color: var(--red); }
.verdict { font-size: var(--fs-caption); color: var(--muted); margin: -4px 4px 12px; }
.verdict.good { color: var(--green); }
.verdict.bad { color: var(--red); }

.cost-table { width: 100%; border-collapse: collapse; font-size: var(--fs-secondary); margin: 16px 0 22px; }
.cost-table th { text-align: left; color: var(--muted); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: 0.08em; padding: 0 12px 8px 0; font-weight: 700; }
.cost-table td { border-top: 1px solid var(--line); padding: 10px 12px 10px 0; vertical-align: top; }
.cost-table td.n { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 650; color: var(--strong); }
.table-scroll { overflow-x: auto; }

.quote-card { border: 1px solid var(--line); border-radius: var(--r-tile); padding: 14px 16px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bot)); box-shadow: var(--card-shadow); font-size: var(--fs-secondary); color: var(--muted); }

.gotcha { border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 12px; background: var(--panel-top); box-shadow: var(--card-shadow); }
.gotcha b { color: var(--strong); display: block; margin-bottom: 4px; }
.gotcha p { margin: 0; font-size: var(--fs-secondary); color: var(--muted); }

.article-footer { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 22px; font-size: var(--fs-secondary); color: var(--muted); }
.article-footer p { margin: 0; }
.article-footer p + p { margin-top: 10px; }
.article-footer .nav-back { margin: 0; }

/* Mobile: tighter shell, no orphaned chips, thumb-width bubbles */
@media (max-width: 700px) {
  .shell { padding: 26px 16px 72px; }
  .nav-back { margin-bottom: 24px; }
  h1 { margin-bottom: 18px; }
  h2 { margin: 34px 0 10px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .bubble { max-width: 92%; }
  .fig { margin: 16px 0 20px; }
}
