.tr-series .blog-post-layout > * { min-width: 0; }
.tr-article { overflow-wrap: break-word; }
.tr-article .post-series-nav { flex-wrap: wrap; }
.tr-article h2, .tr-article h3, .tr-anchor { scroll-margin-top: 6rem; }
.tr-anchor { display: block; height: 0; }
.tr-article .katex-display { max-width: 100%; overflow: auto hidden; padding: .3rem 0; }
.tr-eq { margin: 1.4rem 0; padding: .4rem 1rem; border-left: 3px solid var(--brand); background: rgba(10,143,106,.045); border-radius: 0 8px 8px 0; overflow-x: auto; }
.tr-table { max-width: 100%; overflow-x: auto; margin: 1.5rem 0; }
.tr-table table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tr-table th, .tr-table td { min-width: 110px; padding: .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tr-table th { background: rgba(10,143,106,.065); }
.tr-figure, .tr-demo { margin: 1.8rem 0; padding: 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); scroll-margin-top: 6rem; }
.tr-figure img { display: block; width: 100%; height: auto; }
.tr-figure figcaption, .tr-demo figcaption { margin-top: 1rem; color: var(--ink-muted); font-size: .82rem; line-height: 1.65; }
.tr-demo-title { display: block; font: 700 1.15rem/1.5 'Syne', sans-serif; margin-bottom: 1rem; }
.tr-demo [hidden] { display: none !important; }
/* Small, static examples introduce the operation before matrix notation. */
.tr-article .tr-calculation-steps { list-style: none; counter-reset: calculation; margin: 1.25rem 0 0; padding: 0; }
.tr-calculation-steps > li { position: relative; counter-increment: calculation; padding: 0 0 1.25rem 2.25rem; margin: 0; }
.tr-calculation-steps > li:last-child { padding-bottom: 0; }
.tr-calculation-steps > li::before { content: counter(calculation); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 50%; background: rgba(10,143,106,.1); color: var(--brand); font-size: .8rem; font-weight: 800; }
.tr-calculation-steps > li > strong { font-size: .94rem; line-height: 1.6; }
.tr-article .tr-calculation-steps p { font-size: .85rem; line-height: 1.8; margin: .45rem 0; }
.tr-number-line { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.tr-example-inputs { margin: .8rem 0; }
.tr-example-inputs caption { text-align: left; color: var(--ink-muted); font-size: .8rem; padding-bottom: .5rem; }
.tr-example-inputs th, .tr-example-inputs td { min-width: 0; padding: .5rem .6rem; }
.tr-attention-example .tr-bar { grid-template-columns: 88px minmax(15px,1fr) 62px; gap: .45rem; font-size: .78rem; }
.tr-math-note { margin: 1.3rem 0; padding-block: .8rem; border-block: 1px solid var(--line); }
.tr-math-note summary { cursor: pointer; color: var(--ink-muted); font-weight: 700; font-size: .86rem; line-height: 1.8; }
.tr-math-note summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.tr-mask-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; font-size: .8rem; text-align: center; }
.tr-mask-table th { padding: .5rem .15rem; font-weight: 700; line-height: 1.6; }
.tr-mask-table th:first-child, .tr-mask-table th:last-child { width: 18%; }
.tr-mask-table td { padding: .65rem .1rem; border-radius: 4px; }
.tr-mask-table .is-allowed { background: var(--brand); color: #fff; }
.tr-mask-table .is-blocked { background: rgba(19,32,26,.06); color: var(--ink-muted); }
.tr-mask-target { color: var(--ink); background: rgba(199,113,54,.09); font-weight: 700; }
.tr-feature-flow { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1.25rem; margin: 1.4rem 0; }
.tr-feature-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .65rem; text-align: center; min-width: 0; }
.tr-feature-stage:not(:last-child)::after { content: '→'; position: absolute; right: -1rem; top: 2.75rem; color: var(--ink-muted); }
.tr-feature-stage strong { font-size: .82rem; }
.tr-feature-stage code { display: block; padding: .65rem .3rem; width: 100%; background: rgba(10,143,106,.07); border: 1px solid var(--line); border-radius: 6px; font-size: .86rem; white-space: nowrap; }
.tr-feature-stage.is-activation code { background: rgba(199,113,54,.09); }
.tr-feature-stage small { color: var(--ink-muted); font-size: .75rem; line-height: 1.7; }
.tr-head-reads { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin: 1.3rem 0; }
.tr-head-read { position: relative; padding: .9rem .5rem; border: 1px solid var(--line); border-radius: 7px; background: var(--tr-blue-soft, #edf2fa); text-align: center; min-width: 0; font-size: .85rem; }
.tr-head-read:nth-child(2) { background: var(--tr-warm-soft, #fbf0e4); }
.tr-head-read::after { content: '↓'; position: absolute; bottom: -1.35rem; left: calc(50% - .3rem); color: var(--ink-muted); }
.tr-head-read p { font-size: .8rem; line-height: 1.7; margin: .6rem 0; }
.tr-head-read code { white-space: nowrap; }
.tr-head-join { padding: .9rem; border: 1px solid var(--line); border-radius: 7px; background: rgba(10,143,106,.05); text-align: center; font-size: .88rem; }
.tr-head-join p { margin: .6rem 0 0; font-size: .85rem; line-height: 1.8; }
.tr-norm-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; margin: 1rem 0; }
.tr-norm-table th, .tr-norm-table td { padding: .65rem .1rem; border-bottom: 1px solid var(--line); }
.tr-norm-table th { font-size: .8rem; }
.tr-norm-table th:first-child { width: 24%; text-align: left; }
.tr-norm-table td { font: .8rem/1.6 ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.tr-norm-table [data-norm-ln] { background: var(--tr-blue-soft, #edf2fa); }
.tr-norm-table [data-norm-rms] { background: var(--tr-green-soft, #eaf5ef); }
@media (max-width:650px) {
  .tr-figure, .tr-demo { scroll-margin-top: 11rem; }
  .tr-feature-flow { grid-template-columns: 1fr; gap: 1.4rem; }
  .tr-feature-stage { max-width: 250px; width: 100%; margin: auto; gap: .35rem; }
  .tr-feature-stage:not(:last-child)::after { content: '↓'; top: auto; bottom: -1.25rem; right: calc(50% - .3rem); }
  .tr-mask-table { font-size: .67rem; border-spacing: 2px; }
  .tr-mask-table td { padding-block: .55rem; }
  .tr-calculation-steps > li { padding-left: 1.85rem; }
  .tr-attention-example .tr-bar { grid-template-columns: 74px minmax(12px,1fr) 53px; gap: .3rem; font-size: .68rem; }
  .tr-head-read, .tr-head-read p { font-size: .72rem; }
  .tr-norm-table th { font-size: .69rem; }
  .tr-norm-table td { font-size: .72rem; }
}
.tr-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1.1rem; margin: 1rem 0; }
.tr-controls label { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .85rem; font-weight: 700; }
.tr-controls input, .tr-controls select { accent-color: var(--brand); min-height: 36px; max-width: 100%; }
.tr-controls input[type=range] { width: 145px; }
.tr-controls select, .tr-controls button { font: inherit; font-size: .85rem; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--ink); padding: .55rem .75rem; }
.tr-controls button { cursor: pointer; min-height: 44px; }
.tr-controls button:hover { border-color: var(--brand); }
.tr-controls button:disabled { opacity: .5; cursor: default; }
.tr-controls :focus-visible, .tr-check summary:focus-visible, .tr-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.tr-bars { display: grid; gap: .65rem; margin: 1.2rem 0; }
.tr-bar { display: grid; grid-template-columns: 80px minmax(20px,1fr) 72px; align-items: center; gap: .7rem; font: .85rem/1.4 ui-monospace, monospace; }
.tr-track { height: 20px; border-radius: 4px; background: rgba(10,143,106,.09); overflow: hidden; }
.tr-fill { height: 100%; width: 0; border-radius: 4px; background: var(--brand); transition: width 350ms ease; }
.tr-bar:nth-child(2) .tr-fill { background: #c77136; }
.tr-bar:nth-child(3) .tr-fill { background: #597cb7; }
.tr-bar:nth-child(4) .tr-fill { background: #876aa3; }
.tr-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.tr-status { display: block; padding: 1rem; margin: 1rem 0 0; border-radius: 8px; background: rgba(10,143,106,.055); font-size: .9rem; line-height: 1.8; font-variant-numeric: tabular-nums; white-space: pre-line; }
.tr-demo-note { font-size: .84rem; color: var(--ink-muted); line-height: 1.6; }
.tr-matrix-wrap { overflow-x: auto; }
.tr-matrix { display: grid; grid-template-columns: repeat(8, minmax(25px, 1fr)); gap: 4px; max-width: 420px; min-width: 240px; margin: 1rem auto; }
.tr-cell { display: grid; place-items: center; min-height: 30px; background: #f0ede6; color: #777269; font: .75rem ui-monospace, monospace; border-radius: 3px; transition: background 220ms ease; }
.tr-cell.is-allowed { background: #0a8f6a; color: white; }
.tr-rotation { display: block; max-width: 320px; width: 100%; height: auto; margin: auto; }
.tr-rotation line { stroke-width: 3; }
.tr-readout-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.tr-readout { border: 1px solid var(--line); border-radius: 8px; padding: .8rem; font-size: .82rem; }
.tr-readout strong { display: block; font: 700 1.2rem/1.6 'Syne',sans-serif; color: var(--brand); }
.tr-check { padding: 1rem 1.1rem; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(199,113,54,.045); }
.tr-check summary { cursor: pointer; font-weight: 700; line-height: 1.7; }
.tr-check p { margin-bottom: 0; }
.tr-catalog { display: grid; gap: .7rem; margin-bottom: 1.5rem; }
.tr-article .tr-card { display: block; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; color: var(--ink); background: var(--card); }
.tr-card:hover { border-color: var(--brand); }
.tr-card strong { display: block; font-size: 1rem; }
.tr-card p { margin: .35rem 0 0; color: var(--ink-muted); font-size: .84rem; line-height: 1.6; }
.tr-article .tr-chapter-list { list-style: none; padding: 0; margin: .65rem 0 1.4rem; }
.tr-chapter-list li { margin: .15rem 0; }
.tr-chapter-list a { display: block; width: fit-content; padding: .2rem 0; color: var(--ink); font-size: .9rem; line-height: 1.7; text-decoration: none; }
.tr-chapter-list a:hover { color: var(--brand); text-decoration: underline; }
.tr-chapter-list a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
@media (max-width: 900px) {
  .tr-series .blog-sidebar { max-height: 14rem; overflow-y: auto; }
  .tr-figure, .tr-demo { padding: .9rem; }
  .tr-readout-grid { grid-template-columns: 1fr; }
  .tr-eq { padding-inline: .6rem; }
  .tr-bar { grid-template-columns: 65px minmax(15px,1fr) 62px; gap: .4rem; font-size: .77rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-series *, .tr-series *::before, .tr-series *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
