.blog-post-layout > .blog-sidebar,
.blog-post-layout > .ld-article { min-width: 0; }
.ld-article .post-series-nav { flex-wrap: wrap; }
.ld-article { overflow-wrap: break-word; }
.ld-article h2 { scroll-margin-top: 6rem; }
.ld-article .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 0;
}
.ld-eq {
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  background: rgba(10, 143, 106, 0.045);
  padding: 0.45rem 0.9rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}
.ld-figure {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow-x: auto;
}
.ld-figure img { display: block; width: 100%; height: auto; }
.ld-figure figcaption {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-top: 0.8rem;
}
.ld-table-wrap { max-width: 100%; overflow-x: auto; margin: 1.25rem 0; }
.ld-table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ld-table-wrap th, .ld-table-wrap td {
  padding: 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  min-width: 110px;
}
.ld-table-wrap th { background: rgba(10, 143, 106, 0.055); font-weight: 800; }
.ld-check {
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 107, 53, 0.045);
}
.ld-check summary { cursor: pointer; font-weight: 700; line-height: 1.6; }
.ld-check p { margin-bottom: 0; }
.ld-roadmap { display: grid; gap: 0.75rem; margin: 1.2rem 0; }
.ld-article .ld-chapter {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
}
.ld-chapter:hover { border-color: var(--brand); }
.ld-chapter-number { color: var(--brand); font: 700 1rem/1.5 ui-monospace, monospace; }
.ld-chapter strong { font-size: 1rem; }
.ld-chapter p { margin: 0.4rem 0 0; font-size: 0.88rem; color: var(--ink-muted); }
.ld-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.ld-controls label { font-weight: 700; font-size: 0.85rem; }
.ld-controls input { accent-color: var(--brand); max-width: 100%; min-height: 36px; }
.ld-controls output { font-variant-numeric: tabular-nums; min-width: 3ch; }
.ld-controls button {
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  min-height: 40px;
}
.ld-article :focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.ld-token-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.25rem; }
.ld-token {
  background: #e2f2eb;
  border: 1px solid #a7caba;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  min-width: 60px;
  text-align: center;
  font: 700 0.82rem ui-monospace, monospace;
}
.ld-token.is-mask { background: #f4ece0; border-style: dashed; border-color: #b8a58c; }
.ld-status { font-size: 0.88rem; color: var(--ink-muted); }
.ld-prob-bars { display: grid; gap: 0.7rem; margin-top: 1.2rem; }
.ld-prob-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 4.5rem; gap: 0.6rem; align-items: center; font-size: 0.8rem; }
.ld-prob-track { height: 1.2rem; background: #eee6d9; border-radius: 3px; }
.ld-prob-fill { height: 100%; background: #087856; border-radius: 3px; }
.ld-prob-row.is-invalid .ld-prob-fill { background: #b9461c; }
.ld-prob-value { text-align: right; font-variant-numeric: tabular-nums; }
.ld-algorithm { border-left: 3px solid var(--brand); padding-left: 2rem; }
.ld-algorithm li { padding: 0.3rem 0 0.3rem 0.4rem; }
.ld-article .post-nav > a { min-width: 0; }
@media (max-width: 900px) {
  .ld-series .blog-sidebar { max-height: 14rem; }
  .ld-series .blog-post-layout.sidebar-collapsed { grid-template-columns: 1fr; }
  .ld-series .sidebar-collapsed .blog-sidebar { width: max-content; margin-bottom: 0; }
  .ld-article h2 { scroll-margin-top: 9rem; }
}
@media (max-width: 600px) {
  .ld-figure { padding: 0.75rem; }
  .ld-figure img { min-width: 540px; }
  .ld-eq { padding: 0.4rem 0.55rem; }
  .ld-prob-row { grid-template-columns: 6.3rem minmax(0, 1fr) 3.8rem; gap: 0.4rem; }
  .ld-article .post-nav { flex-direction: column; gap: 1rem; }
  .ld-article .post-nav > a { max-width: 100%; width: 100%; }
  .ld-chapter { gap: 0.65rem; }
}
@media print {
  .ld-figure, .ld-eq, .ld-check { break-inside: avoid; }
  .ld-controls { display: none; }
}
