/* Isolated styles for the BRFT rulebook reader. */
.brft-reader{--brft-navy:#071d32;--brft-red:#cf163d;--brft-border:#d7e0e8;--brft-muted:#53677a;max-width:1190px;margin:32px auto 70px;color:var(--brft-navy);font-family:Arial,Helvetica,sans-serif;line-height:1.6}
.brft-reader,.brft-reader *{box-sizing:border-box}
.brft-reader a{color:#164d86;text-decoration:none}
.brft-reader a:hover{text-decoration:underline}
.brft-r-top{padding:29px 34px;margin-bottom:22px;color:white;background:linear-gradient(115deg,#061b31,#0f324d);border-top:3px solid var(--brft-red)}
.brft-r-top h1{font-weight:750;font-size:clamp(24px,3vw,35px);line-height:1.18;margin:8px 0 10px;color:white}
.brft-r-top>p{margin:0 0 12px;color:#dce8f2}
.brft-r-top .brft-r-kicker{color:#aec3d5;font-size:12px;letter-spacing:.08em;margin:0}
.brft-r-top .brft-r-kicker strong{background:#fff0c7;color:#493b13;padding:3px 7px;border-radius:4px;letter-spacing:0}
.brft-r-actions{display:flex;align-items:center;gap:20px;flex-wrap:wrap}
.brft-reader .brft-r-pdf{display:inline-block;padding:7px 13px;color:white;border:1px solid #7593a8;border-radius:5px;font-size:13px}
.brft-reader .brft-r-languages{margin-left:auto;display:inline-flex;gap:10px;color:#cad8e5;align-items:center;font-size:14px}
.brft-reader .brft-r-languages a{color:#f3f7fb;font-weight:700}
.brft-reader .brft-r-languages a[aria-current=page]{border-bottom:3px solid #e02445}
.brft-r-layout{display:grid;grid-template-columns:minmax(230px,285px) minmax(0,1fr);gap:26px;align-items:start}
.brft-r-sidebar{position:sticky;top:20px;border:1px solid var(--brft-border);border-radius:7px;background:#f6f9fc;box-shadow:0 4px 12px rgba(5,27,48,.045);overflow:hidden}
.brft-r-nav-wrap{padding:15px;max-height:calc(100vh - 46px);overflow-y:auto;overscroll-behavior:contain}
.brft-r-search-label{display:block;font-size:12px;font-weight:700;margin-bottom:7px;color:#344e63}
.brft-reader input.brft-r-filter{width:100%;font-size:14px;padding:9px 10px;border:1px solid #a9bac9;border-radius:5px;background:white;color:#102d43;margin:0 0 12px}
.brft-r-nav-group{padding:0;margin:0 0 6px;border:1px solid #dae4ec;background:#fff;border-radius:6px}
.brft-r-nav-group summary{cursor:pointer;font-weight:700;font-size:12.5px;padding:10px 8px;color:#183e5b;list-style-position:inside}
.brft-r-nav-group summary a{color:inherit}
.brft-r-subnav{border-top:1px solid #e6edf2;padding:5px 0 8px}
.brft-r-subnav a{display:block;padding:6px 12px 6px 14px;font-size:12px;line-height:1.4;color:#284c6a;border-left:3px solid transparent}
.brft-r-toc-l3 a{padding-left:27px}
.brft-r-toc-l4 a{padding-left:41px}
.brft-r-nav a.is-active{background:#e6f0f9;border-left-color:var(--brft-red);color:#073456;font-weight:700}
.brft-r-nav a.is-match{background:#fff3db}
.brft-r-open-toc{display:none}
.brft-r-document{min-width:0;padding:10px 10px 30px 0;font-size:15px;line-height:1.7;overflow-wrap:anywhere}
.brft-r-document h1,.brft-r-document h2,.brft-r-document h3,.brft-r-document h4{color:#0b2c45;line-height:1.3;font-weight:750;scroll-margin-top:30px}
.brft-r-document h1{font-size:27px;border-bottom:2px solid #cc2044;padding:10px 0 11px;margin:29px 0 16px}
.brft-r-document h2{font-size:21px;border-bottom:1px solid #d9e3ed;padding:8px 0 9px;margin:23px 0 12px}
.brft-r-document h3{font-size:17px;margin:18px 0 10px}
.brft-r-document h4{font-size:15px;margin:15px 0 7px}
.brft-r-document p{line-height:1.74;font-size:15px;margin:8px 0 15px;color:#203d51}
.brft-r-document img{max-width:100%;height:auto;display:block;margin:10px auto}
.brft-r-document table{border-collapse:collapse;width:100%;table-layout:auto;margin:17px 0;font-size:13px}
.brft-r-document td,.brft-r-document th{border:1px solid #bdccd9;padding:7px 9px;vertical-align:top;min-width:0}
.brft-r-document thead{background:#ecf2f6}
.brft-r-document blockquote{border-left:3px solid #cf163d;margin:16px 0;padding:6px 15px;background:#f5f8fa}
.brft-r-document .brft-page{margin-bottom:10px}
.brft-r-document .brft-r-end{margin-top:32px;border-top:1px solid #d7e0e8;padding:20px 0}
@media(max-width:800px){.brft-reader{margin:12px auto 35px}.brft-r-top{padding:18px}.brft-r-layout{grid-template-columns:1fr;gap:14px}.brft-r-sidebar{position:relative;top:auto}.brft-r-open-toc{display:block;width:100%;padding:12px 16px;border:0;background:#0c304a;color:white;text-align:left;font-size:15px;cursor:pointer}.brft-r-nav-wrap{display:none;max-height:55vh}.brft-r-sidebar.is-open .brft-r-nav-wrap{display:block}.brft-r-document{padding:0 12px}.brft-r-document h1{font-size:23px}.brft-r-document h2{font-size:19px}.brft-r-document p{font-size:14px}.brft-r-document table{display:block;overflow-x:auto;white-space:normal}}

/* Original PDF diagrams and visual references. */
.brft-r-originals{margin:12px 0 22px}
.brft-r-source-pages{border:1px solid #bfd0de;border-radius:8px;background:#f4f8fb;margin:15px 0 19px}
.brft-r-source-pages>summary{padding:12px 15px;font-weight:700;color:#164d86;cursor:pointer}
.brft-r-source-pages[open]>summary{border-bottom:1px solid #bfd0de}
.brft-r-facsimile-gallery{padding:8px 12px}
.brft-r-facsimile{margin:14px 0 20px;max-width:900px;background:#fff;border:1px solid #d7e0e8;border-radius:6px;padding:6px}
.brft-r-facsimile img{width:100%;max-width:850px;height:auto;margin:0 auto;border-radius:3px}
.brft-r-facsimile figcaption{text-align:center;font-size:12px;color:#526679;padding:7px 4px}
.brft-r-facsimile-label{font-size:13px!important;background:#edf5fa;border-left:3px solid #cf163d;padding:9px 13px}
.brft-r-search-empty{font-size:12px;color:#53677a;padding:5px 10px}
@media(max-width:800px){.brft-r-facsimile-gallery{padding:4px}.brft-r-facsimile{padding:2px}}


/* 0.1.3: zoomable source illustrations, page forms and tables; only within BRFT reader. */
.brft-r-image-open{display:block;width:100%;position:relative;cursor:zoom-in;border:0;background:transparent;padding:0;margin:0;color:inherit;text-align:inherit}
.brft-r-image-open:focus-visible{outline:3px solid #cf163d;outline-offset:4px}
.brft-r-image-open img{pointer-events:none}
.brft-r-image-zoom-cue{display:block;text-align:center;color:#24516c;font-weight:700;font-size:12px;padding:5px 0 1px}
.brft-r-source-note{border-left:3px solid #cf163d;background:#f5f8fa;padding:9px 12px!important;font-size:13px!important}
.brft-r-lightbox[hidden]{display:none!important}
.brft-r-lightbox{position:fixed;inset:0;z-index:2147480000;background:rgba(4,17,30,.95);display:flex;flex-direction:column;color:#fff;font-family:Arial,Helvetica,sans-serif;line-height:1.3}
.brft-r-lightbox *{box-sizing:border-box}
.brft-r-lightbox-controls{flex:0 0 auto;display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap;padding:10px 12px;background:#112d44;border-bottom:1px solid #496478}
.brft-r-lightbox-controls button{background:#f4f7fa;border:1px solid #b8c6d2;color:#0c2940;border-radius:6px;font-size:13px;font-weight:700;padding:9px 12px;cursor:pointer;min-height:40px}
.brft-r-lightbox-controls button:focus-visible{outline:3px solid #f22553;outline-offset:2px}
.brft-r-lightbox-controls button[disabled]{opacity:.4;cursor:not-allowed}
.brft-r-lightbox-title{flex:1 1 130px;color:#fff;font-size:13px;text-align:center;max-width:40vw}
.brft-r-lightbox-viewport{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:flex-start;padding:15px;background:#091725}
.brft-r-lightbox-page{display:block;width:auto;height:auto;max-width:none;max-height:none!important;flex:0 0 auto;margin:0 auto!important;box-shadow:0 8px 25px rgba(0,0,0,.3);background:#fff}
.brft-r-lightbox-caption{flex:0 0 auto;background:#112d44;color:#e6eef4;padding:8px 14px;text-align:center;font-size:12px}
body.brft-r-modal-active{overflow:hidden!important}
@media(max-width:600px){.brft-r-lightbox-controls{justify-content:center;gap:5px;padding:8px 4px}.brft-r-lightbox-controls button{padding:8px 9px;font-size:12px}.brft-r-lightbox-title{display:none}.brft-r-lightbox-viewport{padding:5px}}


/* 0.1.4: one-toggle magnifier, click-to-zoom and drag-to-pan. */
.brft-r-lightbox-controls .brft-r-zoom-toggle{width:43px;min-width:43px;padding:8px;display:inline-flex;align-items:center;justify-content:center}
.brft-r-zoom-toggle svg{display:block}
.brft-r-zoom-toggle.is-zoomed{background:#d9ecf8;border-color:#729ab5}

.brft-r-lightbox-page{cursor:zoom-in}
.brft-r-lightbox-page:focus-visible{outline:3px solid #f22553;outline-offset:4px}
.brft-r-lightbox-viewport.is-zoomed{cursor:grab;touch-action:pan-x pan-y}
.brft-r-lightbox-viewport.is-zoomed:active{cursor:grabbing}
.brft-r-lightbox-viewport.is-zoomed .brft-r-lightbox-page{cursor:zoom-out}
@media(max-width:600px){.brft-r-lightbox-controls .brft-r-zoom-toggle{width:43px;min-width:43px;padding:9px}}

/* Only the optional link addition to the existing Documents listing. */
.brft-rr-online-links{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0!important}.brft-rr-online-links a{display:inline-block;padding:8px 15px;border:1px solid #b9cbd8;border-radius:7px;background:#f5f8fa;color:#102c42!important;text-decoration:none!important;font-weight:700}.brft-rr-online-links a:hover,.brft-rr-online-links a:focus{border-color:#c7193b;background:#fff;outline-offset:2px}

/* The existing rulebook title becomes the natural entry into the reader. */
.brft-rules h3 .brft-rr-title-link{color:inherit;text-decoration:none!important;display:inline-flex;align-items:baseline;gap:.18em;max-width:100%;border-bottom:1px solid transparent;transition:color .15s ease,border-color .15s ease}
.brft-rules h3 .brft-rr-title-link:hover,.brft-rules h3 .brft-rr-title-link:focus-visible{color:#b91839!important;border-bottom-color:currentColor;outline-offset:4px}
.brft-rules .brft-rr-title-arrow{font-size:.75em;color:#c2193c;flex-shrink:0}
@media(prefers-reduced-motion:reduce){.brft-rules h3 .brft-rr-title-link{transition:none}}

/* v0.9.2 – mobile-first rulebook reading and one-tap Documents card. */
.brft-rules article.brft-rr-card {position:relative}
.brft-rules .brft-rr-card h3 {margin-bottom:0!important}
.brft-rules .brft-rr-card .brft-rr-title-link {display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.22em;row-gap:0;width:100%;max-width:none;border:0!important;outline-offset:3px;line-height:1.3}
.brft-rules .brft-rr-card .brft-rr-card-action {display:block;flex:0 0 100%;font-size:14px;font-weight:700;color:#b91839;padding-top:7px;line-height:1.3}
.brft-rules .brft-rr-card .brft-rr-card-action>span {margin-left:4px}
.brft-rules .brft-rr-card .brft-rr-title-link:focus-visible {outline:3px solid #c2193c;outline-offset:5px}
@media (max-width:800px){
  .brft-reader{width:100%;max-width:100%;margin:8px auto 28px;padding:0 10px;min-width:0}
  .brft-r-top{padding:17px 16px;margin-bottom:12px;border-radius:0 0 8px 8px}
  .brft-r-top h1{font-size:clamp(22px,5.6vw,29px);line-height:1.18;overflow-wrap:normal;word-break:normal;margin:9px 0}
  .brft-r-top>p{font-size:13px;line-height:1.55}
  .brft-r-top .brft-r-kicker{font-size:10px;letter-spacing:.04em}
  .brft-r-actions{gap:9px;flex-wrap:wrap;justify-content:space-between}
  .brft-reader .brft-r-pdf{min-height:42px;display:inline-flex;align-items:center;padding:10px 12px}
  .brft-reader .brft-r-languages{margin-left:0;min-height:42px}
  .brft-r-layout{display:block;min-width:0}
  .brft-r-sidebar{position:sticky;top:0;z-index:90;margin-bottom:14px;overflow:visible;border-radius:6px;box-shadow:0 3px 12px rgba(5,27,48,.12)}
  body.admin-bar .brft-r-sidebar{top:46px}
  .brft-r-open-toc{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:47px;padding:11px 15px;border-radius:5px;text-align:left;background:#102f48;color:#fff;font-weight:700;letter-spacing:.01em}
  .brft-r-open-toc::after{content:'⌄';font-size:24px;font-weight:400;line-height:1;transition:transform .15s ease}
  .brft-r-sidebar.is-open .brft-r-open-toc::after{transform:rotate(180deg)}
  .brft-r-nav-wrap{position:absolute;top:calc(100% + 2px);left:-1px;right:-1px;z-index:100;max-height:min(72vh,530px);padding:12px;background:#f6f9fc;border:1px solid #cbd9e5;border-radius:0 0 7px 7px;box-shadow:0 13px 24px rgba(3,24,42,.23);overflow-y:auto;overscroll-behavior:contain}
  .brft-r-nav-group summary{font-size:14px;padding:12px 9px}
  .brft-r-subnav a{font-size:13.5px;padding-top:9px;padding-bottom:9px;min-height:38px}
  .brft-r-document{padding:0 1px 28px;max-width:100%;min-width:0;font-size:15.5px;line-height:1.7;overflow-wrap:break-word}
  .brft-r-document h1,.brft-r-document h2,.brft-r-document h3,.brft-r-document h4{scroll-margin-top:108px;overflow-wrap:break-word}
  .brft-r-document h1{font-size:22px;line-height:1.25}
  .brft-r-document h2{font-size:19px}
  .brft-r-document h3{font-size:17px}
  .brft-r-document p{font-size:15.5px;line-height:1.75}
  .brft-r-document table{display:block;overflow-x:auto;max-width:100%;width:100%;-webkit-overflow-scrolling:touch}
  .brft-r-document pre{overflow-x:auto;max-width:100%}
  .brft-r-lightbox{width:100vw;max-width:100vw}
  .brft-r-lightbox-controls{justify-content:space-between;flex-wrap:nowrap;gap:3px;padding:7px 5px}
  .brft-r-lightbox-controls button{font-size:12px;white-space:nowrap;min-height:43px;padding:7px 9px}
  .brft-r-lightbox-title{display:none}
  .brft-r-lightbox-viewport{padding:4px}
  .brft-r-lightbox-caption{font-size:11px;padding:6px 5px}
  .brft-rules article.brft-rr-card {padding:15px 0!important}
  .brft-rules article.brft-rr-card h3 {font-size:clamp(21px,5vw,27px)!important;line-height:1.25!important}
  .brft-rules .brft-rr-card .brft-rr-title-link {width:100%;line-height:1.25}
  .brft-rules .brft-rr-card .brft-rr-card-action {font-size:15px;padding-top:11px}
}
@media(max-width:360px){
  .brft-reader{padding:0 7px}
  .brft-r-top{padding:15px 12px}
  .brft-r-top h1{font-size:21px}
  .brft-r-lightbox-controls button{padding:7px 6px;font-size:11px}
  .brft-r-document p{font-size:15px}
}
@media(prefers-reduced-motion:reduce){.brft-r-open-toc::after{transition:none}}

/* 0.9.3 — WordPress BRFT THEME integration. Existing theme prints a separate
   page title, then the rulebook title. Remove duplication only for reader pages;
   do not modify other pages, headings, menus or plugins. */
body.brft-rule-reader-page main > section.section.wrap > h1:first-child {
  display: none !important;
}
body.brft-rule-reader-page main > section.section.wrap {
  padding-top: 18px !important;
  padding-bottom: 38px !important;
  min-width: 0;
}
body.brft-rule-reader-page .brft-reader {
  width: 100%;
  max-width: 1190px;
  margin: 0 auto 32px;
  min-width: 0;
}
@media (max-width: 800px) {
  body.brft-rule-reader-page main > section.section.wrap {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    padding: 12px 0 28px !important;
  }
  body.brft-rule-reader-page .brft-reader {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto 20px;
  }
  body.brft-rule-reader-page .brft-r-top,
  body.brft-rule-reader-page .brft-r-layout,
  body.brft-rule-reader-page .brft-r-document {
    max-width: 100%;
    min-width: 0;
  }
  body.brft-rule-reader-page .brft-r-top h1 {
    font-size: clamp(21px, 6vw, 28px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  body.brft-rule-reader-page .brft-r-document img {
    max-width: 100%;
  }
}

/* 1.0.0 dedicated mobile-safe template — isolates reader pages from
   the existing WordPress theme's legacy .section.wrap and global H1. */
html:has(body.brft-reader-isolated){overflow-x:hidden}
body.brft-reader-isolated{margin:0!important;min-width:0!important;width:100%!important;max-width:100%!important;overflow-x:hidden!important;font-size:16px!important}
body.brft-reader-isolated .brft-reader-header{position:relative!important;background:#fff;border-bottom:3px solid #c7193b;padding:0!important;height:auto!important;box-shadow:none;max-width:100%!important}
body.brft-reader-isolated .brft-reader-header-inner{max-width:1190px;margin:auto;padding:12px 18px;display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0}
body.brft-reader-isolated .brft-reader-brand{display:flex;align-items:center;gap:11px;color:#0b2b44!important;text-decoration:none;font-size:17px;font-weight:800;white-space:nowrap;min-width:0}
body.brft-reader-isolated .brft-reader-brand img{max-width:38px;width:38px;height:38px;flex-shrink:0}
body.brft-reader-isolated .brft-reader-return{color:#0a3555!important;font-size:14px;text-decoration:underline;font-weight:600;text-align:right}
body.brft-reader-isolated .brft-reader-main{display:block;min-width:0!important;max-width:100%!important;width:100%!important;overflow:visible!important;padding:0 16px!important;margin:0!important}
body.brft-reader-isolated .brft-reader-footer{max-width:1190px;margin:20px auto 0;padding:19px 18px;border-top:3px solid #c7193b;display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;color:#e8f1fa;background:#0b2840;font-size:13px}
body.brft-reader-isolated .brft-reader-footer a{color:inherit}
body.brft-reader-isolated .brft-reader{max-width:1190px;width:100%!important;min-width:0!important;margin:18px auto 24px!important;padding:0!important;line-height:1.6!important}
body.brft-reader-isolated .brft-reader *{max-width:100%;box-sizing:border-box}
body.brft-reader-isolated .brft-r-top h1{font-size:clamp(23px,3.1vw,34px)!important;overflow-wrap:break-word!important;word-break:normal!important;line-height:1.18!important}
body.brft-reader-isolated .brft-r-document{min-width:0!important;max-width:100%!important;overflow-wrap:break-word!important;word-break:normal!important}
body.brft-reader-isolated .brft-r-document p{font-size:15px!important;line-height:1.68!important;margin-top:10px!important}
body.brft-reader-isolated .brft-r-document h1{font-size:clamp(20px,2.5vw,27px)!important;line-height:1.25!important;overflow-wrap:break-word!important}
body.brft-reader-isolated .brft-r-document h2{font-size:clamp(18px,2.1vw,21px)!important;line-height:1.3!important}
body.brft-reader-isolated .brft-r-document h3{font-size:17px!important;line-height:1.4!important}
body.brft-reader-isolated .brft-r-document table{max-width:100%;width:100%;display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:normal}
body.brft-reader-isolated .brft-r-document img{max-width:100%!important;height:auto!important}
body.brft-reader-isolated .brft-r-source-pages img,body.brft-reader-isolated .brft-original-sheet img{max-width:100%!important;height:auto!important}
.brft-original-sheet{margin:12px 0 23px;border:1px solid #d3e0ea;border-radius:7px;padding:6px;background:#fff;max-width:100%;min-width:0}
.brft-original-sheet img{width:100%!important;height:auto!important;display:block;margin:0 auto!important;max-width:100%!important}
.brft-original-sheet figcaption{padding:7px 4px;color:#53677a;font-size:12px!important;text-align:center}
.brft-translated-annex{margin:14px 0 22px;padding:10px;border:1px solid #c2d5e3;background:#f4f8fb;border-radius:7px}
.brft-translated-annex>summary{font-size:15px;font-weight:700;color:#0a456e;cursor:pointer;padding:7px 4px}
.brft-original-caption{padding:8px 12px;background:#f0f6fa;border-left:3px solid #c7193b;font-size:13px!important}
@media(max-width:800px){
 body.brft-reader-isolated .brft-reader-main{padding:0 12px!important}
 body.brft-reader-isolated .brft-reader{margin:12px auto 22px!important}
 body.brft-reader-isolated .brft-r-top{padding:17px 15px!important}
 body.brft-reader-isolated .brft-r-top h1{font-size:clamp(21px,5.5vw,27px)!important}
 body.brft-reader-isolated .brft-r-layout{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important}
 body.brft-reader-isolated .brft-r-sidebar{position:sticky!important;top:0;z-index:90;max-width:100%!important;min-width:0!important;margin-bottom:18px}
 body.admin-bar.brft-reader-isolated .brft-r-sidebar{top:46px!important}
 body.brft-reader-isolated .brft-r-nav-wrap{display:none;max-width:100%!important}
 body.brft-reader-isolated .brft-r-sidebar.is-open .brft-r-nav-wrap{display:block!important}
 body.brft-reader-isolated .brft-r-open-toc{display:flex!important;font-size:15px!important;line-height:1.3!important}
 body.brft-reader-isolated .brft-r-document{width:100%!important;padding:0!important}
 body.brft-reader-isolated .brft-r-document h1{font-size:21px!important}
 body.brft-reader-isolated .brft-r-document h2{font-size:19px!important}
 body.brft-reader-isolated .brft-r-document h3{font-size:17px!important}
 body.brft-reader-isolated .brft-r-document p{font-size:15px!important}
}
@media(max-width:360px){body.brft-reader-isolated .brft-reader-main{padding:0 8px!important}.brft-reader-header-inner{padding:10px!important}}


/* Keep the site's original BRFT navigation/header, not an alternate one. */
body.brft-reader-isolated .brft-reader-breadcrumb{max-width:1190px;margin:12px auto -5px;padding:0 2px;font-size:13px}
body.brft-reader-isolated .brft-reader-breadcrumb a{color:#164d86;font-weight:600;text-decoration:underline}
@media(max-width:800px){body.brft-reader-isolated .brft-reader-breadcrumb{margin-top:8px}}


/* MOBILE ONLY: reader's standalone WordPress page avoids the theme's oversized
   legacy page heading and respects the device viewport. This does NOT apply to
   other pages. */
body.brft-reader-isolated .brft-reader-main,
body.brft-reader-isolated .brft-r-top,
body.brft-reader-isolated .brft-r-layout,
body.brft-reader-isolated .brft-r-document,
body.brft-reader-isolated .brft-r-sidebar{min-inline-size:0!important;max-inline-size:100%!important}
body.brft-reader-isolated .brft-r-document{overflow-wrap:break-word!important;word-break:normal!important}
body.brft-reader-isolated .brft-r-document .brft-page{min-width:0!important}
body.brft-reader-isolated .brft-r-document img{max-width:100%!important;height:auto!important}
body.brft-reader-isolated .brft-reader-header-placeholder{display:none}
@media (max-width:800px) {
  body.brft-reader-isolated .brft-reader-main{padding-inline:12px!important}
  body.brft-reader-isolated .brft-r-layout{display:block!important}
  body.brft-reader-isolated .brft-r-document{font-size:15px!important;line-height:1.7!important;padding:0!important}
  body.brft-reader-isolated .brft-r-document p{font-size:15px!important;line-height:1.7!important}
  body.brft-reader-isolated .brft-r-document h1{font-size:21px!important;line-height:1.3!important}
  body.brft-reader-isolated .brft-r-document h2{font-size:19px!important;line-height:1.35!important}
  body.brft-reader-isolated .brft-r-document h3{font-size:17px!important;line-height:1.4!important}
  body.brft-reader-isolated .brft-r-sidebar{position:sticky!important;top:0!important;width:100%!important;z-index:90!important}
  body.admin-bar.brft-reader-isolated .brft-r-sidebar{top:46px!important}
  body.brft-reader-isolated .brft-r-open-toc{display:flex!important;align-items:center;justify-content:space-between;font-size:15px!important;white-space:normal!important;line-height:1.35!important;min-height:48px}
  body.brft-reader-isolated .brft-r-nav-wrap{display:none;max-width:100%!important}
  body.brft-reader-isolated .brft-r-sidebar.is-open .brft-r-nav-wrap{display:block!important}
  body.brft-reader-isolated .brft-r-nav-wrap .brft-r-nav{max-width:100%;overflow-x:hidden}
  body.brft-reader-isolated .brft-r-rules{max-width:100%}
  body.brft-reader-isolated .brft-r-document table{width:100%!important;max-width:100%!important;display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media(max-width:359px){body.brft-reader-isolated .brft-reader-main{padding-inline:8px!important}}

/* Universal reader: embedded PDF fallback for rulebooks without online text. */
.brft-reader .brft-ur-pdf-frame{display:block;width:100%;height:min(77vh,1080px);min-height:570px;border:1px solid #c9d7e3;border-radius:7px;background:#eef3f7}
@media(max-width:800px){.brft-reader .brft-ur-pdf-frame{height:74vh;min-height:440px}}

/* Keep responsive sticky navigation out of a synthetic overflow container. */
html:has(body.brft-reader-isolated){overflow-x:clip!important;}
body.brft-reader-isolated{overflow-x:clip!important;}

/* Desktop: persistent navigation. The page scrolls to the chosen article,
   while the left index retains its own scroll position (also in wp-admin preview). */
@media (min-width:801px) {
  html:has(body.brft-reader-isolated) { overflow-x:clip!important; }
  body.brft-reader-isolated { overflow-x:clip!important; overflow-y:visible!important; }
  body.brft-reader-isolated .brft-reader-main,
  body.brft-reader-isolated .brft-reader,
  body.brft-reader-isolated .brft-r-layout { overflow:visible!important; }
  body.brft-reader-isolated .brft-r-layout { align-items:stretch; }
  body.brft-reader-isolated .brft-r-sidebar {
    align-self:start;
    position:sticky!important;
    top:18px!important;
    max-height:calc(100vh - 36px);
    max-height:calc(100dvh - 36px);
    z-index:8;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  body.admin-bar.brft-reader-isolated .brft-r-sidebar {
    top:52px!important;
    max-height:calc(100vh - 70px);
    max-height:calc(100dvh - 70px);
  }
  body.brft-reader-isolated .brft-r-nav-wrap {
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  body.brft-reader-isolated .brft-r-document h1,
  body.brft-reader-isolated .brft-r-document h2,
  body.brft-reader-isolated .brft-r-document h3,
  body.brft-reader-isolated .brft-r-document h4 { scroll-margin-top:26px; }
}
