/* Generic table layout: keep the source table and its header associations. */
.entry-content table.tbw-responsive-table{width:100%!important;max-width:100%;min-width:0!important;table-layout:fixed}
.entry-content table.tbw-responsive-table :is(th,td){white-space:normal!important;overflow-wrap:anywhere;min-width:0}
.entry-content .tbw-responsive-table-frame,
.entry-content .table-is-responsive:has(> table.tbw-responsive-table){width:100%!important;max-width:100%;min-width:0!important;overflow:visible!important}
@media(max-width:900px){
 .entry-content table.tbw-responsive-table{display:block!important;border:0!important;background:transparent!important}
 .entry-content table.tbw-responsive-table thead{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
 .entry-content table.tbw-responsive-table tbody{display:block!important;width:100%!important}
 .entry-content table.tbw-responsive-table tbody tr{display:block!important;width:100%!important;min-width:0!important;margin:0 0 14px!important;padding:8px!important;border:1px solid #cbd5e1!important;border-radius:10px;background:#fff;box-sizing:border-box}
 .entry-content table.tbw-responsive-table tbody :is(td,th){display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:8px!important;border:0!important;border-bottom:1px solid #e2e8f0!important;box-sizing:border-box;line-height:1.45!important;font-size:16px!important}
 .entry-content table.tbw-responsive-table tbody :is(td,th):last-child{border-bottom:0!important}
 .entry-content table.tbw-responsive-table tbody :is(td,th)::before{content:attr(data-label);display:block;margin-bottom:3px;font:700 14px/1.3 Montserrat,sans-serif;color:#334155;white-space:normal}
 .entry-content .tbw-responsive-table-frame{overflow:visible!important;width:100%!important;max-width:100%;min-width:0!important}
 .entry-content :is(.tbw-rag-table-wrap,.tbw-voice-scroll):has(> .tbw-responsive-table-frame){width:100%!important;max-width:100%;min-width:0!important;overflow:visible!important}
}

/* Compact section navigation; touch targets remain 44px and no sideways pan. */
@media(max-width:800px){
 .entry-content :is(.tbw-rag-nav,.tbw-voice-nav){position:static!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible!important;white-space:normal!important;gap:4px!important}
 .entry-content .tbw-rag-nav-inner{display:contents!important;overflow:visible!important}
 .entry-content :is(.tbw-rag-nav,.tbw-voice-nav) a{display:flex!important;align-items:center;justify-content:center;min-width:0!important;min-height:44px;white-space:normal!important;text-align:center;overflow-wrap:anywhere;padding:8px!important}
}

/* The interactive Voice SVG's 1200px source fits the shared desktop box only without inherited 22px side padding. */
.entry-content .tbw-voice-svg-scroll.tbw-rv-host{padding-inline:0!important}

/* Existing inline card grids and the homepage architecture flow use the same narrow-content contract. */
body.page .entry-content [style*="grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))"]{grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr))!important}
@media(max-width:600px){
 .tbw3 .tbw3-flow{grid-template-columns:minmax(0,1fr)!important;gap:7px!important;font-size:16px!important;margin:16px 0!important}
 .tbw3 .tbw3-flow>div{min-width:0;width:100%;min-height:52px;padding:8px}
 .tbw3 .tbw3-flow>p{line-height:1;min-height:20px}
 .tbw3 .tbw3-flow>p span{display:inline-block;transform:rotate(90deg)}
}

/* Responsive semantic fallback: show only when source labels cannot remain readable. */
.tbw-rv,.tbw-rv-pre { display:none; }
.tbw-rv-ready .tbw-rv-original.tbw-rv-hidden { display:none !important; }
.tbw-rv-ready .tbw-rv-visible { display:block !important; }
.tbw-rv-ready .tbw-rv-host.tbw-rv-active { min-width:0 !important; max-width:100% !important; width:auto !important; overflow:visible !important; height:auto !important; max-height:none !important; }
.tbw-rv-ready .tbw-rv-host.tbw-rv-active:has(> .tbw-rv-visible) { padding-inline:0; }
.tbw-rv { box-sizing:border-box; width:100%; max-width:100%; min-width:0; padding:clamp(12px,4vw,20px); margin:0 0 1rem; border:1px solid #647c90; border-radius:12px; background:#12273b; color:#f0f7ff; font:400 1rem/1.5 system-ui,sans-serif; overflow-wrap:anywhere; }
.tbw-rv *, .tbw-rv *::before, .tbw-rv *::after { box-sizing:border-box; min-width:0; max-width:100%; }
.tbw-rv-group { margin:0 0 1.15rem; }
.tbw-rv-group:last-child { margin-bottom:0; }
.tbw-rv-heading { color:#8ee8f4; font-size:1.05rem; line-height:1.4; margin:0 0 .5rem; }
.tbw-rv-source-heading { font-weight:700; margin:.2rem 0; }
.tbw-rv-list { display:grid; grid-template-columns:minmax(0,1fr); gap:.45rem; list-style:none; padding:0; margin:0; counter-reset:rv; }
.tbw-rv-list:where(ol) { list-style:none!important; }
.tbw-rv-list:where(ol) > li { counter-increment:rv; list-style:none!important; }
.tbw-rv-list:where(ol) > li::before { content:none; }
.tbw-rv-card,.tbw-rv-relation { padding:.6rem .75rem; border:1px solid #526c83; border-radius:8px; background:#1b354b; color:#f0f7ff; overflow-wrap:anywhere; }
.tbw-rv-emphasis { border-color:#e2c463; }
.tbw-rv-label { display:block; }
.tbw-rv-sequence-label { display:inline-block; margin-right:.35rem; color:#8ee8f4; font-weight:700; }
.tbw-rv-label + .tbw-rv-label { margin-top:.18rem; }
.tbw-rv-stage-button { display:block; width:100%; min-height:44px; padding:.3rem; background:transparent; border:0; color:inherit; text-align:left; font:inherit; cursor:pointer; white-space:normal; }
.tbw-rv-stage-button[aria-pressed=true] { color:#ffe17b; font-weight:700; }
.tbw-rv-stage-button:focus-visible { outline:3px solid #ffe17b; outline-offset:3px; border-radius:3px; }
.tbw-rv-note { border-left:1px solid #e2c463; padding-left:.7rem; font-size:.92rem; }
.tbw-rv-pre { white-space:normal !important; font:400 1rem/1.5 system-ui,sans-serif; color:#f0f7ff; background:#12273b; }
.tbw-rv-pre .tbw-rv-list:where(ol) { list-style:decimal outside!important; padding-left:1.5rem; }
.tbw-rv-pre .tbw-rv-list:where(ol) > li { list-style:decimal outside!important; }
.tbw-rv-attachment { display:block; margin-top:.28rem; color:#d8ecff; }

/* Protect the dark diagram palette from every authored page's heading/list
   styles, including future pages; preserve emphasis and selected stages. */
.tbw-rv :is(h1,h2,h3,h4,h5,h6,p,li,button,span) { color:inherit !important; }
.tbw-rv .tbw-rv-heading,
.tbw-rv .tbw-rv-sequence-label { color:#8ee8f4 !important; }
.tbw-rv .tbw-rv-stage-button[aria-pressed="true"] { color:#ffe17b !important; }
.tbw-rv .tbw-rv-attachment { color:#d8ecff !important; }

/* Shared split-hero contract: keep its introduction first and give a long
   diagram its own full-width row. The host class stays stable when the
   readable SVG/semantic alternative is chosen by the resize observer. */
@media (min-width:769px) {
  .entry-content :is(.wrap.hero,.tbw-rag-split,.tbw-voice-split):has(> .tbw-rv-host) {
    grid-template-columns:minmax(0,1fr) !important;
    align-items:start;
  }
  .entry-content :is(.wrap.hero,.tbw-rag-split,.tbw-voice-split):has(> .tbw-rv-host) > :first-child {
    max-width:72ch;
  }
  .entry-content :is(.wrap.hero,.tbw-rag-split,.tbw-voice-split):has(> .tbw-rv-host) > .tbw-rv-host {
    width:100%; max-width:100%; min-width:0; margin-inline:0;
  }
}
@media (min-width:1100px) {
  .entry-content :is(.wrap.hero,.tbw-rag-split,.tbw-voice-split) > .tbw-rv-host > .tbw-rv-visible .tbw-rv-list {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
