/* KR Gemara module. Intentionally isolated from library and siddur styles. */
:root{--gm-bg:#17140f;--gm-ink:#30271b;--gm-paper:#fff6df;--gm-card:#282117;--gm-gold:#e6c87e;--gm-border:#b79a5f;--gm-text:#f6e7ca;--gm-accent:#79471e;--gm-font:19px;--gm-focus:#ffea8b;color-scheme:dark}
:root.gm-light{--gm-bg:#f2ebdc;--gm-card:#fff9ec;--gm-text:#372714;--gm-gold:#79531b;--gm-border:#ad976d;color-scheme:light}
*{box-sizing:border-box}body{margin:0;background:var(--gm-bg);color:var(--gm-text);font-family:Arial,"Noto Sans Hebrew",sans-serif;line-height:1.6}button,input,select,textarea{font:inherit}button{cursor:pointer;border-radius:10px;border:1px solid var(--gm-border);background:var(--gm-card);color:var(--gm-text);padding:9px 13px;min-height:43px}button:hover,button:focus-visible,a:focus-visible{outline:2px solid #d6a93f;outline-offset:2px}button.selected,.gm-primary{background:#efce86;color:#352211;font-weight:800;border-color:#d7b66a}.gm-primary:hover{background:#fbe0a8}.gm-top{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--gm-border);padding:10px max(3vw,15px);background:var(--gm-card)}.gm-brand{display:flex;align-items:center;gap:12px}.gm-brand img{border-radius:50%;object-fit:contain}.gm-brand small{font-size:12px;display:block;opacity:.86}.gm-brand h1{font-size:clamp(19px,3vw,29px);margin:0;color:var(--gm-gold)}.gm-back{color:var(--gm-gold);font-size:13px;text-decoration:none;white-space:nowrap}.gm-header-tools{display:flex;gap:7px}main{margin:auto;max-width:1490px;padding:14px clamp(9px,2vw,26px) 40px}.gm-controls,.gm-options{display:flex;align-items:end;flex-wrap:wrap;gap:9px;padding:11px;border:1px solid var(--gm-border);border-radius:15px;background:var(--gm-card);margin-bottom:11px}.gm-field{display:flex;flex-direction:column;gap:2px}.gm-field label{font-size:12px;opacity:.9}.gm-field select,.gm-field input,.gm-search input{background:var(--gm-bg);color:var(--gm-text);border:1px solid var(--gm-border);border-radius:8px;padding:10px;min-height:43px}.gm-field select{min-width:150px}.gm-daf input{width:78px}.gm-side select{min-width:75px}.gm-ribbon{display:flex;justify-content:space-between;gap:13px;align-items:center;flex-wrap:wrap;margin:10px 2px;font-size:13px}.gm-ribbon #gmLocation{font-weight:bold;color:var(--gm-gold);font-size:16px}.gm-ribbon #gmStatus{opacity:.9}.gm-options{align-items:center}.gm-modes,.gm-typography{display:flex;gap:4px}.gm-search{display:flex;align-items:center;gap:7px}.gm-search span{font-size:13px;white-space:nowrap}.gm-search input{width:160px}.gm-notice{padding:9px 15px;border-radius:10px;border:1px solid var(--gm-border);font-size:14px;background:var(--gm-card);margin:12px 0}.gm-sheet{background:var(--gm-paper);color:var(--gm-ink);border:7px double #795e38;box-shadow:0 5px 35px #0006;padding:clamp(9px,1.5vw,25px);min-height:510px;max-width:1340px;margin:16px auto;font-family:"Frank Ruhl Libre","David", "Noto Serif Hebrew",serif}.gm-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:6px;text-align:center;border-bottom:3px double #645139;padding:4px 0 11px}.gm-sheet-head span{font-size:clamp(11px,1.3vw,17px)}.gm-sheet-head strong{font-size:clamp(22px,2.6vw,33px)}.gm-daf-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.68fr) minmax(0,1fr);gap:10px;direction:rtl}.gm-column{min-width:0;text-align:justify;unicode-bidi:plaintext;line-height:1.48}.gm-column h2{text-align:center;font-size:22px;color:#433121;border-bottom:1px solid #aa906c;margin:0 0 12px;padding:9px 4px}.gm-gemara{border-right:1px solid #bcaa90;border-left:1px solid #bcaa90;padding:0 13px}.gm-gemara .gm-paragraphs{font-size:calc(var(--gm-font) + 2px);font-weight:500}.gm-rashi .gm-paragraphs,.gm-tosafot .gm-paragraphs{font-size:var(--gm-font)}.gm-p{position:relative;margin:0 0 11px;overflow-wrap:anywhere;white-space:pre-wrap;padding:3px 0 3px 25px;direction:rtl}.gm-p:hover{background:#efdeb759}.gm-segment-tools{position:absolute;left:0;top:0;border:0;background:transparent;color:#80521f;padding:2px;min-height:26px;line-height:1;font-size:16px;opacity:.45}.gm-p:hover .gm-segment-tools,.gm-segment-tools:focus{opacity:1}.gm-p mark{background:#ffdc5d;border-radius:2px;box-decoration-break:clone;padding:1px 0}.gm-p mark.gm-search-mark{background:#a2e7ca}.gm-p.gm-has-note:before{content:'✎';color:#80521f;position:absolute;left:20px;top:0;font-size:11px}.gm-placeholder{text-align:center;font-size:16px;padding:30px 10px;opacity:.7}.gm-credit{margin-top:15px;border-top:1px solid #b59c70;padding-top:7px;font-size:12px;text-align:center}.gm-credit a{color:#563d17}.gm-notebook{margin-top:19px;background:var(--gm-card);border:1px solid var(--gm-border);border-radius:17px;padding:18px}.gm-notebook h2{margin:0;color:var(--gm-gold);font-size:23px}.gm-notebook p{margin:6px 0 10px;font-size:13px}.gm-note-tools{display:flex;gap:8px;flex-wrap:wrap}.gm-note-row{padding:12px;margin:10px 0;border:1px solid var(--gm-border);border-radius:11px}.gm-note-row strong{color:var(--gm-gold)}.gm-note-row blockquote{margin:7px 0;font-size:14px;border-right:3px solid var(--gm-gold);padding-right:9px}.gm-note-row p{white-space:pre-wrap}.gm-note-row button{font-size:13px;min-height:32px;padding:4px 10px;margin-inline-start:8px}footer{text-align:center;font-size:12px;opacity:.84;padding-top:15px}footer a{color:var(--gm-gold)}.gm-modal:not([hidden]){position:fixed;inset:0;background:#000a;display:flex;justify-content:center;align-items:center;padding:13px;z-index:400}.gm-modal-dialog{background:var(--gm-card);color:var(--gm-text);border:1px solid var(--gm-gold);padding:21px;border-radius:17px;max-width:530px;width:100%;box-shadow:0 10px 35px #0009}.gm-modal-dialog h2{margin:0 0 9px}.gm-modal-dialog p{max-height:140px;overflow:auto;white-space:pre-wrap;font-size:13px}.gm-modal-dialog textarea{width:100%;background:var(--gm-bg);border:1px solid var(--gm-border);color:var(--gm-text);padding:10px;border-radius:9px;resize:vertical}.gm-modal-actions{display:flex;gap:9px;justify-content:end;margin-top:12px}.gm-sheet.gm-focus .gm-daf-grid{display:block;max-width:810px;margin:auto}.gm-sheet.gm-focus .gm-gemara{border:0;padding:0}.gm-sheet.gm-focus .gm-rashi,.gm-sheet.gm-focus .gm-tosafot{display:none}
@media(max-width:920px){.gm-daf-grid{gap:7px}.gm-gemara{padding:0 7px}.gm-column h2{font-size:18px}.gm-brand img{width:38px;height:38px}.gm-sheet{border-width:4px}.gm-gemara .gm-paragraphs{font-size:var(--gm-font)}.gm-rashi .gm-paragraphs,.gm-tosafot .gm-paragraphs{font-size:calc(var(--gm-font) - 2px)}}
@media(max-width:650px){.gm-brand{gap:6px}.gm-back{font-size:11px;max-width:53px;white-space:normal;line-height:1.15}.gm-top{padding:8px}.gm-header-tools button{padding:5px 8px;min-height:35px}.gm-controls{gap:6px}.gm-field select{min-width:132px}.gm-options{justify-content:flex-start}.gm-search{flex:1}.gm-search input{width:100%;min-width:90px}.gm-sheet{margin:10px -3px}.gm-daf-grid{display:flex;flex-direction:column}.gm-gemara{order:0;border:0;border-bottom:2px solid #aaa08d;padding:0 0 9px}.gm-rashi{order:1;border-bottom:2px solid #aaa08d}.gm-tosafot{order:2}.gm-column h2{margin-top:10px;font-size:19px}.gm-sheet:not(.gm-focus) .gm-column{display:block}.gm-sheet-head strong{font-size:23px}}

/* 15.14.24: Traditional folio retains the right/center/left structure at *all* screen sizes. */
.gm-paper-scroller{overflow-x:auto;overscroll-behavior-inline:contain;max-width:100%;border-radius:3px;scrollbar-color:#b49a67 #f2e3c1;direction:rtl;scroll-behavior:smooth}
.gm-sheet{min-width:760px;max-width:1100px;width:100%;margin:8px auto 16px}
.gm-daf-grid{display:grid;direction:rtl;grid-template-columns:minmax(0,1fr) minmax(0,1.7fr) minmax(0,1fr);gap:7px}
.gm-daf-grid .gm-column{display:block;min-width:0}
.gm-column h2{font-family:inherit}
.gm-p{white-space:normal;overflow-wrap:break-word;line-height:1.57;text-align:justify;margin-bottom:7px}
.gm-gemara{order:initial}.gm-rashi{order:initial}.gm-tosafot{order:initial}
.gm-content-warning{background:#3b1916;color:#ffe6d8;border:2px solid #db967e;border-radius:12px;margin:12px 0;padding:15px;line-height:1.7;font-weight:700}
.gm-content-warning[hidden]{display:none}.gm-content-warning a{color:#ffe39b}
.gm-sheet.gm-incomplete{border-color:#b55544}
.gm-sheet.gm-incomplete .gm-daf-grid{display:none}
.gm-daf select{width:90px;min-width:90px;font-size:18px;font-weight:700}
@media(max-width:650px){
 .gm-sheet{min-width:760px;max-width:760px;width:760px;margin:8px 0 16px;padding:12px;border-width:6px}
 .gm-daf-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.7fr) minmax(0,1fr);gap:7px}
 .gm-gemara{border-right:1px solid #bcaa90;border-left:1px solid #bcaa90;padding:0 8px;order:initial}
 .gm-rashi{border-bottom:0;order:initial}.gm-tosafot{order:initial}
 .gm-gemara .gm-paragraphs{font-size:18px}.gm-rashi .gm-paragraphs,.gm-tosafot .gm-paragraphs{font-size:15px}
 .gm-column h2{font-size:18px;margin:0 0 10px;padding:7px 3px}
 .gm-sheet:not(.gm-focus) .gm-column{display:block}
 .gm-sheet.gm-focus{min-width:0;width:100%}.gm-sheet.gm-focus .gm-daf-grid{display:block}.gm-sheet.gm-focus .gm-rashi,.gm-sheet.gm-focus .gm-tosafot{display:none}
}

/* 15.14.25: Vilna-inspired flowing folio. Side commentaries are CSS floats, not a fixed three-track grid.
   Gemara text flows *between* them and can expand to full folio width after they end.
   The digital text is not an exact facsimile of historical Vilna typesetting. */
.gm-sheet{background:#fff6dd;border:2px solid #6c573b;outline:1px solid #a38c69;outline-offset:-8px;padding:20px 22px 14px;min-width:840px;max-width:1070px;width:100%;box-shadow:0 6px 25px #0005;font-family:"Noto Serif Hebrew","Frank Ruhl Libre","David",serif;}
.gm-sheet-head{display:grid;grid-template-columns:90px minmax(0,1fr) 90px;align-items:start;border:0;padding:0 8px 8px;line-height:1.12}
.gm-sheet-head strong{font-size:34px;color:#21170d;letter-spacing:.3px}
.gm-sheet-head .gm-folio-meta{font-size:16px;line-height:1.18;font-weight:800;text-align:center;color:#241c11}
.gm-folio-rule{margin:0 0 6px;border-top:2px solid #493a27;border-bottom:1px solid #493a27;height:7px;text-align:center;position:relative}
.gm-folio-rule span{position:absolute;left:49%;top:-18px;font-size:17px;color:#553f27;background:#fff6dd;padding:0 5px}
.gm-daf-grid{display:flow-root !important;direction:rtl;font-size:16px;line-height:1.28;min-height:430px;}
.gm-daf-grid .gm-column{display:block;unicode-bidi:normal;text-align:justify;min-width:0}
.gm-daf-grid .gm-rashi{float:right;width:24%;margin:0 0 10px 1.3%;padding:0 0 0 10px;direction:rtl;}
.gm-daf-grid .gm-tosafot{float:left;width:24%;margin:0 1.3% 10px 0;padding:0 10px 0 0;direction:rtl;}
.gm-daf-grid .gm-gemara{display:block;width:auto;float:none;order:initial;border:0;padding:0;margin:0;direction:rtl;min-width:0;}
.gm-daf-grid .gm-column h2{font-size:19px;border:0;border-bottom:1px solid #8e7c62;text-align:center;margin:0 0 6px;padding:1px 0 4px;color:#271d0d;letter-spacing:.2px}
.gm-daf-grid .gm-gemara h2{font-size:17px;border-bottom:0;margin-bottom:3px}
.gm-daf-grid .gm-gemara .gm-paragraphs{font-size:calc(var(--gm-font) + 1px);line-height:1.4;font-weight:600;}
.gm-daf-grid .gm-rashi .gm-paragraphs,.gm-daf-grid .gm-tosafot .gm-paragraphs{font-size:calc(var(--gm-font) - 5px);line-height:1.28;font-weight:500;}
.gm-daf-grid .gm-rashi .gm-paragraphs{font-family:"Noto Rashi Hebrew","Noto Serif Hebrew","David",serif;}
.gm-daf-grid .gm-p{padding:0 11px 0 0;margin:0 0 7px;white-space:normal;text-align:justify;text-align-last:auto;line-height:inherit;overflow-wrap:break-word;word-break:normal;}
.gm-daf-grid .gm-p:first-child .gm-txt::first-letter{font-weight:900;font-size:1.15em;}
.gm-daf-grid .gm-segment-tools{right:-8px;left:auto;top:0;font-size:11px;min-height:16px;padding:0;background:#fff6ddbd;opacity:.28;}
.gm-daf-grid .gm-p:hover .gm-segment-tools,.gm-daf-grid .gm-segment-tools:focus{opacity:1}
.gm-daf-grid .gm-p.gm-has-note:before{right:0;left:auto;font-size:9px;}
.gm-folio-bottom-rule{clear:both;border-top:2px solid #5f5038;border-bottom:1px solid #5f5038;height:5px;margin:12px 0 8px;}
.gm-credit{font-size:10px;line-height:1.4;margin:0;border:0;padding-top:0;color:#53432d;}
.gm-sheet.gm-incomplete .gm-daf-grid{display:none!important}
/* Classic page is intentionally wider than mobile and pans horizontally (like a physical daf). */
@media(max-width:920px){.gm-sheet{min-width:840px;max-width:840px;width:840px;margin:10px 0 16px;padding:17px 17px 13px;border-width:2px}.gm-daf-grid{display:flow-root!important}.gm-daf-grid .gm-rashi{width:24%;margin-left:1.2%}.gm-daf-grid .gm-tosafot{width:24%;margin-right:1.2%}.gm-daf-grid .gm-gemara{display:block;float:none;border:0;padding:0;margin:0}.gm-sheet:not(.gm-focus) .gm-column{display:block}.gm-daf-grid .gm-gemara .gm-paragraphs{font-size:calc(var(--gm-font) + 1px)}.gm-daf-grid .gm-rashi .gm-paragraphs,.gm-daf-grid .gm-tosafot .gm-paragraphs{font-size:calc(var(--gm-font) - 5px)}.gm-sheet-head strong{font-size:30px}}
.gm-sheet.gm-focus{min-width:0;max-width:850px;width:100%;padding:20px;}
.gm-sheet.gm-focus .gm-daf-grid{display:block!important;max-width:760px;margin:auto;min-height:auto}
.gm-sheet.gm-focus .gm-rashi,.gm-sheet.gm-focus .gm-tosafot{display:none!important}
.gm-sheet.gm-focus .gm-gemara{float:none;display:block;max-width:none;width:100%}
.gm-sheet.gm-focus .gm-gemara h2{font-size:21px}
.gm-sheet.gm-focus .gm-gemara .gm-paragraphs{font-size:calc(var(--gm-font) + 2px);line-height:1.7}
@media(max-width:650px){.gm-sheet.gm-focus{padding:12px;min-width:0;width:100%;}.gm-sheet.gm-focus .gm-sheet-head{grid-template-columns:45px 1fr 45px}.gm-sheet.gm-focus .gm-sheet-head strong{font-size:23px}.gm-sheet.gm-focus .gm-sheet-head .gm-folio-meta{font-size:12px}}
@media print{body{background:white}.gm-top,.gm-controls,.gm-ribbon,.gm-options,.gm-notice,.gm-notebook,footer,.gm-segment-tools{display:none!important}.gm-paper-scroller{overflow:visible!important}.gm-sheet{box-shadow:none;border:1px solid black;max-width:none;width:100%;min-width:0;page-break-inside:auto}.gm-daf-grid .gm-p{break-inside:avoid}}

/* 15.14.26: Two-phase folio. As soon as Gemara ends, Rashi/Tosafot continue
   below in two almost half-width columns, instead of leaving a blank center.
   JS moves the original paragraph DOM nodes (never clones) to retain notes/marks. */
.gm-sheet.gm-flow-wide .gm-daf-grid{display:grid!important;grid-template-columns:24% minmax(0,1fr) 24%;gap:1.4%;min-height:0;direction:rtl;align-items:start}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi{grid-column:1;grid-row:1;float:none!important;width:auto!important;margin:0!important;padding:0 9px 0 0;align-self:start;border:none}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara{grid-column:2;grid-row:1;float:none!important;width:auto!important;margin:0!important;padding:0;align-self:start;min-width:0;border:none}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot{grid-column:3;grid-row:1;float:none!important;width:auto!important;margin:0!important;padding:0 0 0 9px;align-self:start;border:none}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-column .gm-p{margin-bottom:7px}
.gm-sheet.gm-flow-wide .gm-daf-continued:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4%;clear:both;direction:rtl;margin-top:10px;padding:14px 4px 2px;border-top:2px solid #68563c;align-items:start}
.gm-sheet.gm-flow-wide .gm-daf-continued h2{font-size:19px;text-align:center;border-bottom:1px solid #8e7c62;color:#271d0d;margin:0 0 8px;padding:0 0 5px}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-paragraphs{font-family:"Noto Serif Hebrew","Frank Ruhl Libre","David",serif;font-weight:500;font-size:calc(var(--gm-font) - 3px);line-height:1.48;text-align:justify;direction:rtl}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-wide-rashi .gm-paragraphs{font-family:"Noto Rashi Hebrew","Noto Serif Hebrew","David",serif}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-p{padding:0 14px 0 0;margin:0 0 7px;text-align:justify;overflow-wrap:break-word;word-break:normal;white-space:normal;line-height:inherit}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-segment-tools{right:-6px;left:auto;top:0;background:#fff6ddbd;opacity:.34;font-size:11px;min-height:17px;padding:0}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-p:hover .gm-segment-tools,.gm-sheet.gm-flow-wide .gm-daf-continued .gm-segment-tools:focus{opacity:1}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-p.gm-has-note:before{right:0;left:auto}
.gm-sheet.gm-focus .gm-daf-continued,.gm-sheet.gm-incomplete .gm-daf-continued{display:none!important}
@media(max-width:920px){.gm-sheet.gm-flow-wide .gm-daf-grid{display:grid!important;grid-template-columns:24% minmax(0,1fr) 24%;gap:1.4%}.gm-sheet.gm-flow-wide .gm-daf-continued:not([hidden]){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4%}}
@media print{.gm-sheet.gm-flow-wide .gm-daf-continued:not([hidden]){display:grid!important}}

/* 15.14.27 — continuation adapts to whichever commentary is still present.
   The splitting height itself is computed from the actual Gemara bounding box. */
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-rashi:not([hidden]),
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-tosafot:not([hidden]){grid-template-columns:minmax(0,1fr);gap:0}
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-rashi .gm-wide-tosafot,
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-tosafot .gm-wide-rashi{display:none}
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-rashi .gm-wide-rashi,
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-tosafot .gm-wide-tosafot{grid-column:1/-1;width:100%;min-width:0}
@media(max-width:920px){
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-rashi:not([hidden]),
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-tosafot:not([hidden]){grid-template-columns:minmax(0,1fr)}
}

/* 15.14.43 — third reflow region: the longer commentary dynamically occupies
   the ENTIRE folio width as soon as the shorter continuation has ended. */
.gm-sheet.gm-flow-wide .gm-single-continued:not([hidden]){display:block;direction:rtl;clear:both;padding:11px 12px 3px;margin-top:3px;border-top:1px solid #9c8866;min-width:0;width:100%}
.gm-sheet.gm-flow-wide .gm-single-continued h2{font-size:19px;text-align:center;border-bottom:1px solid #8e7c62;color:#271d0d;margin:0 0 8px;padding:0 0 5px}
.gm-sheet.gm-flow-wide .gm-single-continued .gm-paragraphs{font-family:"Noto Serif Hebrew","Frank Ruhl Libre","David",serif;font-weight:500;font-size:calc(var(--gm-font) - 3px);line-height:1.48;text-align:justify;direction:rtl}
.gm-sheet.gm-flow-wide .gm-single-continued.gm-full-rashi .gm-paragraphs{font-family:"Noto Rashi Hebrew","Noto Serif Hebrew","David",serif}
.gm-sheet.gm-flow-wide .gm-single-continued .gm-p{padding:0 14px 0 0;margin:0 0 7px;text-align:justify;overflow-wrap:break-word;word-break:normal;white-space:normal;line-height:inherit}
.gm-sheet.gm-flow-wide .gm-single-continued .gm-segment-tools{right:-6px;left:auto;top:0;background:#fff6ddbd;opacity:.34;font-size:11px;min-height:17px;padding:0}
.gm-sheet.gm-flow-wide .gm-single-continued .gm-p:hover .gm-segment-tools,.gm-sheet.gm-flow-wide .gm-single-continued .gm-segment-tools:focus{opacity:1}
.gm-sheet.gm-flow-wide .gm-single-continued .gm-p.gm-has-note:before{right:0;left:auto}
.gm-sheet.gm-focus .gm-single-continued,.gm-sheet.gm-incomplete .gm-single-continued{display:none!important}
@media print{.gm-sheet.gm-flow-wide .gm-single-continued:not([hidden]){display:block!important}}

/* 15.14.43 — subtle adaptive Vilna folio proportions and classical typography.
   The ratios are based on the actual commentary lengths, bounded to keep
   Gemara central and dominant; they are not tied to one specific daf. */
.gm-sheet.gm-flow-wide .gm-daf-grid,
.gm-sheet.gm-flow-wide .gm-daf-grid{grid-template-columns:var(--gm-rashi-width,24%) minmax(0,1fr) var(--gm-tosafot-width,24%);gap:1.25%}
.gm-sheet.gm-flow-wide .gm-daf-continued:not([hidden]){grid-template-columns:minmax(0,var(--gm-wide-rashi-width,1fr)) minmax(0,var(--gm-wide-tosafot-width,1fr));gap:3%}
/* Restore the canonical single-column continuation rules despite the adaptive ratio. */
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-rashi:not([hidden]),
.gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-tosafot:not([hidden]){grid-template-columns:minmax(0,1fr)}
/* Compact editorial markers: a book-like running folio rather than stacked cards. */
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-column h2{font-size:16px;letter-spacing:0;border-bottom:1px solid #ac9a7b;margin-bottom:4px;padding:0 0 3px}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara h2{font-size:15px;border-bottom:0;opacity:.84}
.gm-sheet.gm-flow-wide .gm-daf-continued:not([hidden]){margin-top:5px;padding-top:8px;border-top:1px solid #8c775a}
.gm-sheet.gm-flow-wide .gm-daf-continued h2,
.gm-sheet.gm-flow-wide .gm-single-continued h2{font-size:15px;line-height:1.25;border:0;margin:0 0 5px;padding:0;color:#4c3825}
.gm-sheet.gm-flow-wide .gm-single-continued:not([hidden]){border-top:1px solid #aa997f;margin-top:4px;padding-top:8px}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-p{line-height:1.34}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi .gm-p,
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot .gm-p{line-height:1.29}
/* Dynamic widths apply equally on narrow devices where folio pans horizontally. */
@media(max-width:920px){
  .gm-sheet.gm-flow-wide .gm-daf-grid{grid-template-columns:var(--gm-rashi-width,24%) minmax(0,1fr) var(--gm-tosafot-width,24%);gap:1.25%}
  .gm-sheet.gm-flow-wide .gm-daf-continued:not([hidden]){grid-template-columns:minmax(0,var(--gm-wide-rashi-width,1fr)) minmax(0,var(--gm-wide-tosafot-width,1fr));gap:3%}
  .gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-rashi:not([hidden]),
  .gm-sheet.gm-flow-wide .gm-daf-continued.gm-only-tosafot:not([hidden]){grid-template-columns:minmax(0,1fr)}
}


/* 15.14.43 — adaptive RESPONSIVE daf across phone / tablet / iPad / laptop / desktop.
   Preserve legible traditional page on phones via horizontal panning; on iPads
   and larger screens fit the page to the available content area without zoom.
   Only the Gemara module is styled here; existing site/siddur unaffected. */
:root{--gm-folio-min:760px}
.gm-paper-scroller{
  width:100%;max-width:100%;min-width:0;
  overflow-x:auto;overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:auto;
  touch-action:pan-x pan-y pinch-zoom;
  scroll-padding-inline:10px;
  overscroll-behavior-inline:contain;
}
.gm-sheet:not(.gm-focus){
  width:100%;max-width:1100px;min-width:var(--gm-folio-min);
  margin:10px auto 16px;
}
.gm-sheet.gm-focus{width:100%;min-width:0;max-width:850px;margin:10px auto 16px}
.gm-page-hint{font-size:12px;color:var(--gm-gold);text-align:center;margin:3px 0 8px;display:none}
.gm-controls,.gm-options{max-width:100%;min-width:0}
.gm-field{min-width:0}
.gm-search{min-width:0}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:clamp(17px,calc(var(--gm-font) + 1px),36px)}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi .gm-paragraphs,
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot .gm-paragraphs{font-size:clamp(14px,calc(var(--gm-font) - 4px),31px)}
/* Desktop large: elegant centered folio, not ultra-wide difficult lines. */
@media(min-width:1400px){
  main{max-width:1560px;padding-inline:clamp(24px,3vw,54px)}
  .gm-sheet:not(.gm-focus){max-width:1180px}
  .gm-sheet-head strong{font-size:36px}
  .gm-sheet.gm-flow-wide .gm-daf-grid{gap:1.3%}
}
/* Medium desktops / landscape tablets: use all available width. */
@media(min-width:960px) and (max-width:1399px){
  main{max-width:100%;padding-inline:clamp(12px,2vw,28px)}
  .gm-sheet:not(.gm-focus){max-width:1100px;min-width:0;padding:clamp(14px,2vw,22px)}
}
/* iPad portrait, small tablets, phones in landscape: fluid three-column folio. */
@media(min-width:690px) and (max-width:959px){
  main{padding-inline:clamp(8px,1.5vw,18px)}
  .gm-sheet:not(.gm-focus){min-width:0;max-width:none;width:100%;padding:clamp(10px,1.6vw,16px)}
  .gm-sheet-head{grid-template-columns:60px minmax(0,1fr) 60px}
  .gm-sheet-head strong{font-size:clamp(24px,3.7vw,31px)}
  .gm-sheet-head .gm-folio-meta{font-size:13px}
  .gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi{padding-inline-start:3px}
  .gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot{padding-inline-end:3px}
  .gm-controls{gap:7px}
  .gm-options{gap:6px}
  .gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:clamp(17px, var(--gm-font), 31px)}
}
/* Smartphones: readable 3-column page and intuitive horizontal swipe. */
@media(max-width:689px){
  main{padding:9px 8px 30px;max-width:100%}
  .gm-top{gap:6px;padding:7px 9px}
  .gm-brand{min-width:0;gap:6px}
  .gm-brand h1{font-size:clamp(16px,4.6vw,23px)}
  .gm-brand small{font-size:10px;line-height:1.3}
  .gm-brand img{width:34px;height:34px}
  .gm-header-tools{flex:none;gap:4px}
  .gm-header-tools button{min-width:32px;min-height:36px;padding:5px 7px}
  .gm-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:10px}
  .gm-controls .gm-field:first-child{grid-column:1/-1}
  .gm-controls .gm-field select{width:100%;min-width:0}
  .gm-controls .gm-daf select{width:100%}
  .gm-controls #gmGo{grid-column:1/-1}
  .gm-controls #gmResume{grid-column:1/-1}
  .gm-controls button{min-width:0}
  .gm-options{gap:7px;padding:8px}
  .gm-options .gm-modes{flex:1 1 100%}
  .gm-options .gm-modes button{flex:1}
  .gm-options .gm-search{flex:1 1 100%}
  .gm-options .gm-search input{flex:1;width:100%;min-width:0}
  .gm-options .gm-typography{align-items:center}
  .gm-ribbon #gmLocation{font-size:14px}
  .gm-notice{font-size:12px;line-height:1.5;padding:8px 10px}
  .gm-page-hint:not([hidden]){display:block}
  .gm-sheet:not(.gm-focus){min-width:760px;max-width:none;width:760px;margin:6px 0 12px;padding:13px 14px;border-width:2px}
  .gm-sheet.gm-focus{min-width:0;width:100%;max-width:100%;margin:6px 0 12px;padding:12px}
  .gm-sheet:not(.gm-focus) .gm-sheet-head{grid-template-columns:65px minmax(0,1fr) 65px}
  .gm-sheet:not(.gm-focus) .gm-sheet-head strong{font-size:28px}
  .gm-sheet:not(.gm-focus) .gm-sheet-head .gm-folio-meta{font-size:13px}
  .gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:clamp(18px,var(--gm-font),34px)}
  .gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi .gm-paragraphs,
  .gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot .gm-paragraphs{font-size:clamp(15px,calc(var(--gm-font) - 3px),31px)}
  .gm-notebook{padding:12px}
  .gm-notebook h2{font-size:19px}
  .gm-modal-dialog{max-height:92dvh;overflow-y:auto;padding:14px}
}
/* Truly small phones: keep the page navigable with full-width controls, but
   do NOT shrink the three commentary columns into unreadable text. */
@media(max-width:360px){
  .gm-sheet:not(.gm-focus){min-width:740px;width:740px;padding:12px}
  .gm-top .gm-back{max-width:38px}
  .gm-options button{font-size:13px;padding:7px 8px}
}
@media print{
  .gm-page-hint{display:none!important}
  .gm-sheet:not(.gm-focus){min-width:0!important;width:100%!important;max-width:none!important}
  .gm-paper-scroller{overflow:visible!important}
}

/* 15.14.43 — gestures inside the folio: one finger pans; two fingers adjust
   reading font size in JavaScript without magnifying the toolbar. */
@media (pointer:coarse){
 .gm-paper-scroller{touch-action:pan-x pan-y;-webkit-user-select:text;user-select:text}
 .gm-sheet{touch-action:pan-x pan-y}
}

/* 15.14.43 — isolated immersive folio; does not change the rest of the site. */
.gm-fullscreen-toolbar{display:none}
.gm-full-page-button{font-weight:800;border-color:#d3ad5d;background:#302617;color:#f2d995}
body.gm-fs-body-locked{overflow:hidden!important}
.gm-paper-scroller.gm-fs-active{
 position:fixed!important;inset:0!important;z-index:2147483000!important;
 display:block!important;box-sizing:border-box!important;
 width:100vw!important;height:100dvh!important;max-width:none!important;
 margin:0!important;padding:8px 10px 20px!important;
 overflow:auto!important;overflow-x:auto!important;overflow-y:auto!important;
 background:#1b1712!important;overscroll-behavior:contain;
 -webkit-overflow-scrolling:touch;
}
.gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar{
 position:sticky;top:0;z-index:5;display:flex!important;align-items:center;
 justify-content:space-between;gap:12px;direction:rtl;
 width:100%;padding:6px 10px;margin:0 auto 8px;max-width:1130px;
 border-radius:9px;background:#201b16ed;color:#f3ddab;
 box-shadow:0 2px 8px #0007;font:700 13px Arial,sans-serif;
}
.gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar button{
 min-height:35px;padding:4px 12px;border:1px solid #b48f43;
 background:#3c3020;color:#ffedc9;font-size:13px;white-space:nowrap;
}
.gm-paper-scroller.gm-fs-active .gm-sheet:not(.gm-focus){
 width:calc(100% - 4px)!important;min-width:700px!important;
 max-width:1140px!important;margin:0 auto 16px!important;
 padding:clamp(9px,1.2vw,18px)!important;
}
/* A portrait handset with orientation lock disabled receives a true rotated
   folio surface; screen height becomes the readable *width* of the page. */
.gm-paper-scroller.gm-fs-active.gm-fs-rotated{
 inset:auto!important;top:0!important;left:100vw!important;right:auto!important;bottom:auto!important;
 width:100dvh!important;height:100vw!important;min-width:0!important;
 transform:rotate(90deg)!important;transform-origin:top left!important;
}
.gm-paper-scroller.gm-fs-active.gm-fs-rotated .gm-sheet:not(.gm-focus){
 width:calc(100% - 4px)!important;min-width:min(700px,100%)!important;
}
.gm-paper-scroller.gm-fs-active.gm-fs-rotated .gm-fullscreen-toolbar{font-size:12px}
/* Native fullscreen Android is usually landscape after orientation lock. */
.gm-paper-scroller:fullscreen{background:#1b1712!important}
@media(max-width:689px){
 .gm-full-page-button{flex:1 1 100%;min-height:45px;font-size:16px}
 .gm-paper-scroller.gm-fs-active{touch-action:pan-x pan-y}
 .gm-paper-scroller.gm-fs-active .gm-sheet:not(.gm-focus){border-width:2px}
}
@media print{
 .gm-fullscreen-toolbar,.gm-full-page-button{display:none!important}
}

/* v15.14.43 — marginal notes of Vilna-style daf, no overlay or shrinkage of core text. */
.gm-marginalia{margin:13px 0 8px;padding:12px 8px 6px;border-top:2px double #8d7c5f;border-bottom:1px solid #af9871;direction:rtl;color:#302517}
.gm-marginalia-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline;flex-wrap:wrap}
.gm-marginalia-head h2{font-size:clamp(15px,calc(var(--gm-font) - 3px),23px);font-weight:800;margin:0 0 5px;color:#342414}
.gm-marginalia-head span{font-size:12px;color:#69543a}
.gm-marginalia-disclaimer{font-size:11px;line-height:1.5;opacity:.78;margin:0 0 10px}
.gm-marginalia-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;align-items:start}
.gm-margin-section{border:1px solid #bdab8f;padding:3px 7px;background:rgba(255,251,239,.28);min-width:0;overflow-wrap:anywhere}
.gm-margin-section>summary{cursor:pointer;font-family:"Noto Serif Hebrew","David",serif;font-size:clamp(13px,calc(var(--gm-font) - 4px),19px);font-weight:800;line-height:1.5;padding:2px 2px 4px}
.gm-margin-body{border-top:1px solid #c6b79e;padding:6px 1px;max-height:430px;overflow:auto;overscroll-behavior:contain}
.gm-margin-entry{position:relative;padding:4px 3px 7px 2px;border-bottom:1px solid #d8c8ab;line-height:1.45;font-size:clamp(12px,calc(var(--gm-font) - 5px),17px)}
.gm-margin-entry:last-of-type{border:0}
.gm-margin-number{color:#725635;margin-inline-end:5px}
.gm-margin-ref{font-weight:700}
.gm-margin-text{margin:4px 0;white-space:pre-wrap;font-family:"Noto Rashi Hebrew","Noto Serif Hebrew","David",serif;text-align:justify}
.gm-margin-anchor{padding:1px 4px!important;margin-inline-end:6px;border:1px solid #b3996c!important;border-radius:3px;background:transparent!important;color:#5c391a!important;font-size:11px!important}
.gm-margin-source{display:inline-block;font-size:11px;color:#64391e;margin-inline-start:6px;text-decoration:underline}
.gm-margin-empty,.gm-margin-license{color:#6b5d4c;font-size:12px;margin:5px 0}
.gm-p.gm-apparatus-focus{outline:2px solid #b68c3b;background:#f9e1a58a;border-radius:3px}
@media(max-width:510px){.gm-marginalia-groups{grid-template-columns:minmax(0,1fr)}.gm-marginalia{padding:8px 4px}}
@media print{.gm-margin-section{break-inside:avoid}.gm-margin-body{max-height:none;overflow:visible}}

/* v15.14.43 — user font control: REAL 8px minimum, up to 42px.
   Override the older responsive font-size minimums (14/15/17/18px) that
   previously prevented the +/- and pinch controls from reducing text below them.
   Do not shrink the page viewport, change stored marks, or affect site fonts. */
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:clamp(8px,calc(var(--gm-font) + 1px),43px)}
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi .gm-paragraphs,
.gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot .gm-paragraphs{font-size:clamp(8px,calc(var(--gm-font) - 4px),38px)}
.gm-sheet.gm-flow-wide .gm-daf-continued .gm-paragraphs,
.gm-sheet.gm-flow-wide .gm-single-continued .gm-paragraphs{font-size:clamp(8px,calc(var(--gm-font) - 3px),39px)}
.gm-sheet.gm-focus .gm-gemara .gm-paragraphs{font-size:clamp(8px,calc(var(--gm-font) + 2px),44px)}
@media (min-width:690px) and (max-width:959px){
 .gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:clamp(8px,var(--gm-font),42px)}
}
@media (max-width:689px){
 .gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:clamp(8px,var(--gm-font),42px)}
 .gm-sheet.gm-flow-wide .gm-daf-grid .gm-rashi .gm-paragraphs,
 .gm-sheet.gm-flow-wide .gm-daf-grid .gm-tosafot .gm-paragraphs{font-size:clamp(8px,calc(var(--gm-font) - 3px),39px)}
}

/* At displayed size 8, ALL three core text columns have a real 8px font. */
html[data-gm-font8="true"] .gm-sheet.gm-flow-wide .gm-daf-grid .gm-gemara .gm-paragraphs{font-size:8px}
/* Compact marginal notes track the same user setting; source links stay tappable. */
.gm-marginalia .gm-margin-entry{font-size:clamp(8px,calc(var(--gm-font) - 5px),17px)}
.gm-marginalia .gm-margin-section>summary{font-size:clamp(8px,calc(var(--gm-font) - 4px),19px)}
.gm-marginalia .gm-marginalia-head h2{font-size:clamp(9px,calc(var(--gm-font) - 3px),23px)}

/* 15.14.43 — ink-on-paper Vilna margin rails; NO bottom accordion cards.
   The central Gemara, Rashi/Tosafot, and full-screen engine are unchanged. */
.gm-folio-body{display:grid;grid-template-columns:minmax(60px,8%) minmax(0,1fr) minmax(60px,8%);gap:5px;direction:rtl;align-items:start;position:relative;isolation:isolate;margin-top:7px}
.gm-folio-content{grid-row:1;grid-column:2;min-width:0;position:relative}
.gm-folio-margin{position:relative;grid-row:1;min-width:0;min-height:100%;padding:0 3px;color:#382b1c;border-inline-start:1px solid #b7a184}
.gm-folio-margin-right{grid-column:1;border-inline-start:0;border-inline-end:1px solid #b7a184}
.gm-folio-margin-left{grid-column:3}
.gm-rail-heading{font-family:"Noto Serif Hebrew","David",serif;font-size:10px;text-align:center;font-weight:800;border-bottom:1px solid #a49071;padding:0 0 4px;line-height:1.2;color:#57412d}
.gm-rail-notes{position:relative;width:100%;min-height:45px}
.gm-rail-entry{position:absolute;right:0;left:0;width:100%;padding:1px 2px 3px;border-bottom:1px solid #d5c5a9;font-family:"Noto Serif Hebrew","David",serif;font-size:8px;line-height:1.18;overflow-wrap:anywhere;direction:rtl}
.gm-rail-entry-head{display:flex;gap:2px;flex-wrap:wrap;font-weight:800;line-height:1.1}
.gm-rail-entry-marker{color:#7b4f2e}
.gm-rail-open{font:inherit!important;color:#402b1c!important;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;line-clamp:5;text-align:right;border:0!important;border-radius:0!important;min-height:0!important;height:auto!important;width:100%;padding:2px 0 0!important;background:transparent!important;box-shadow:none!important;line-height:1.22!important;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere;white-space:normal}
.gm-rail-open:hover,.gm-rail-open:focus-visible{background:#e5d3a48a!important;outline:1px solid #af8553}
.gm-rail-jump{font-size:8px!important;border:0!important;min-height:0!important;height:18px!important;padding:0 3px!important;background:transparent!important;color:#714a30!important}
.gm-rail-noanchor{font-size:7px;opacity:.76;display:block}
.gm-rail-unlocated{border-inline-start:2px dotted #aa9473;padding-inline-start:2px}
.gm-margin-key{font-size:10px;text-align:center;margin:7px 0 2px;padding:3px 4px;border-top:1px dotted #baa586;color:#745c3d;direction:rtl}
.gm-margin-detail-text{white-space:pre-wrap;max-height:55vh;overflow:auto;color:var(--gm-text);font-size:16px;line-height:1.5;direction:rtl}
#gmMarginDialogSource a{color:var(--gm-gold)}
.gm-folio-margin .gm-rail-heading{white-space:normal}
/* Preserve a legible 3-column folio plus 2 extremely narrow margin rails. */
.gm-sheet.gm-flow-wide .gm-folio-content .gm-daf-grid{gap:1.1%}
.gm-sheet:not(.gm-focus){min-width:max(var(--gm-folio-min),880px)}
.gm-sheet.gm-focus .gm-folio-body{display:block}
.gm-sheet.gm-focus .gm-folio-margin{display:none}
.gm-sheet.gm-focus .gm-folio-content{width:100%}
.gm-sheet.gm-focus .gm-margin-key{display:none}
.gm-sheet.gm-incomplete .gm-folio-margin{display:none}
@media(max-width:920px){.gm-sheet:not(.gm-focus){min-width:880px}.gm-folio-body{grid-template-columns:66px minmax(0,1fr) 66px;gap:3px}.gm-rail-entry{font-size:8px}}
@media print{.gm-margin-key,.gm-rail-jump{display:none}.gm-folio-margin,.gm-rail-entry{break-inside:avoid}.gm-sheet:not(.gm-focus){min-width:0!important}}

/* v15.14.43: all-five-column folio FIT view for phone portrait. Keep the
   original 880px Vilna layout and transform its presentation as one unit.
   The stage claims only the scaled intrinsic height, preventing blank space.
   In landscape / tablet / fullscreen, all old presentation is unchanged. */
.gm-fit-stage{position:relative;max-width:none}
.gm-fit-toggle{display:none;font-weight:800;border-color:#b79a5b}
.gm-fit-hint{display:none;font-size:12px;line-height:1.5;text-align:center;color:#eacc88;margin:4px 2px 8px}
@media(max-width:689px) and (orientation:portrait){
  .gm-fit-toggle{display:inline-flex;align-items:center;justify-content:center;flex:1 1 100%}
  .gm-fit-stage.gm-fit-on{position:relative;margin-inline:auto;max-width:none;min-width:0;direction:rtl}
  .gm-fit-stage.gm-fit-on>.gm-sheet:not(.gm-focus){
    position:absolute!important;top:0!important;right:0!important;left:auto!important;
    width:880px!important;min-width:880px!important;max-width:none!important;
    margin:0!important;transform:scale(var(--gm-fit-scale,1));transform-origin:top right;
  }
  .gm-paper-scroller.gm-fit-reading{overflow-x:hidden;overflow-y:visible}
  .gm-paper-scroller.gm-fit-reading.gm-fit-zoomed{overflow-x:auto}
  .gm-fit-hint:not([hidden]){display:block}
  /* The transform does not modify text or interactive annotations. */
}
/* Browser print and actual fullscreen always use the original full-size page. */
@media print{.gm-fit-toggle,.gm-fit-hint{display:none!important}.gm-fit-stage.gm-fit-on>.gm-sheet{position:static!important;transform:none!important;width:100%!important;min-width:0!important}.gm-fit-stage.gm-fit-on{height:auto!important;width:auto!important}}

/* 15.14.43: portrait native/fallback fullscreen uses the same fit-to-width
   880px folio as normal portrait. Rotate only when the user rotates device. */
@media(max-width:689px) and (orientation:portrait){
 .gm-paper-scroller.gm-fs-active.gm-fit-reading{overflow-x:hidden!important;overflow-y:auto!important}
 .gm-paper-scroller.gm-fs-active.gm-fit-reading.gm-fit-zoomed{overflow-x:auto!important}
 .gm-paper-scroller.gm-fs-active.gm-fit-reading .gm-fit-stage.gm-fit-on > .gm-sheet:not(.gm-focus){
   width:880px!important;min-width:880px!important;max-width:none!important;
   position:absolute!important;top:0!important;right:0!important;left:auto!important;
   margin:0!important;transform:scale(var(--gm-fit-scale,1))!important;
   transform-origin:top right!important;
 }
}

/* 15.14.43: Official world Daf Yomi schedule (a separate study shortcut). */
.gm-daily{margin:10px 0 12px;padding:13px 17px;border-radius:14px;border:1px solid var(--gm-border);background:linear-gradient(125deg,var(--gm-card),#40301b);color:#f8e9c9}
.gm-daily-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:7px}
.gm-daily-header strong{font-size:clamp(18px,2.2vw,22px);color:#f4d78c}
.gm-daily-header span{font-size:13px;opacity:.9}
.gm-daily p{margin:7px 0;font-size:14px}
.gm-daily-actions{display:flex;flex-wrap:wrap;align-items:center;gap:9px}
.gm-daily-actions button{min-height:42px}
.gm-daily-actions button:disabled{opacity:.48;cursor:default}
.gm-daily-actions a{color:#ffe3a2;font-size:13px}
.gm-daily .gm-daily-footnote{opacity:.8;font-size:12px;margin:9px 0 0}
:root.gm-light .gm-daily{background:#f7ecd3;color:#3a2714}
:root.gm-light .gm-daily-header strong,:root.gm-light .gm-daily-actions a{color:#6d430b}

/* Daf Yomi Push reminder control; opt-in and Israel timezone. */
.gm-daily-reminder{margin-top:9px;border-top:1px solid #927d58;padding-top:9px}
.gm-daily-reminder-panel{padding:12px 2px 4px;display:grid;gap:12px}
.gm-daily-reminder-panel[hidden]{display:none}
.gm-remind-line{display:flex;flex-wrap:wrap;align-items:center;gap:12px;font-weight:700}
.gm-remind-line input[type="time"]{padding:9px;border:1px solid #9f864c;border-radius:8px;direction:ltr;color:#1b150e;background:#fff9e8}
.gm-remind-days{border:1px solid #9f864c;border-radius:12px;display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.gm-remind-days label{display:flex;gap:4px;align-items:center;min-height:32px}
.gm-daily-reminder-panel input[type="checkbox"]{width:18px;height:18px;accent-color:#d9a63d}
@media(max-width:690px){.gm-daily-reminder-panel{gap:14px}.gm-remind-days{gap:7px}}

/* v15.14.43: high-contrast light UI, keeping the Vilna paper itself untouched. */
:root.gm-light :is(.gm-top,.gm-controls,.gm-options,.gm-ribbon,.gm-notebook,.gm-daily){background:#fff9ec;color:#352515;border-color:#bea575}
:root.gm-light :is(.gm-top,.gm-controls,.gm-options,.gm-notebook,.gm-daily) button:not(.gm-primary):not(.selected){background:#f5e7c8;color:#352515;border:1px solid #b99b61}
:root.gm-light :is(.gm-controls,.gm-options,.gm-daily,.gm-notebook) :is(input,select,textarea){background:#fffdf7;color:#352515;border:1px solid #b99b61}
:root.gm-light .gm-daily :is(.gm-daily-reminder-panel,.gm-remind-days){background:#fbf0da;color:#352515;border-color:#b99b61}
:root.gm-light .gm-daily :is(.gm-daily-reminder-panel,.gm-remind-days) label{color:#352515}
:root.gm-light .gm-daily-reminder-panel input[type="checkbox"]{accent-color:#946318}
:root.gm-light .gm-daily :is(button,input,select):focus-visible{outline:3px solid #ab791c;outline-offset:2px}


/* Smart Ink 15.14.44 — scoped to /gemara/ only. */
.gm-p .gm-txt{user-select:text;-webkit-user-select:text;touch-action:auto}
.gm-p mark.gm-ink-highlight{border-radius:3px;box-decoration-break:clone;-webkit-box-decoration-break:clone;cursor:pointer}
.gm-p mark.gm-ink-highlight[data-color=yellow],.gm-ink-chip[data-color=yellow]{background:#ffdf68;color:#30270d}
.gm-p mark.gm-ink-highlight[data-color=green],.gm-ink-chip[data-color=green]{background:#a4e4af;color:#153b20}
.gm-p mark.gm-ink-highlight[data-color=blue],.gm-ink-chip[data-color=blue]{background:#addafb;color:#163b60}
.gm-p mark.gm-ink-highlight[data-color=pink],.gm-ink-chip[data-color=pink]{background:#f5b9d5;color:#52203a}
.gm-p mark.gm-share-highlight{background:#ffbd54;color:#33220b;box-shadow:0 0 0 1px #d28b1d}
.gm-ink-menu[hidden],.gm-ink-overlay[hidden]{display:none!important}
.gm-ink-menu{position:fixed;direction:rtl;z-index:650;width:min(370px,calc(100vw - 16px));padding:9px;background:#fffcf5;color:#2e2318;border:1px solid #bd9c5c;box-shadow:0 12px 36px #0007;border-radius:16px;display:flex;flex-direction:column;gap:8px;font-family:Arial,"Noto Sans Hebrew",sans-serif}
.gm-ink-menu-colors,.gm-ink-menu-actions{display:flex;align-items:center;justify-content:space-around;gap:4px}
.gm-ink-menu .gm-ink-color{border-radius:50%;width:32px;height:32px;min-height:32px;border:2px solid #8b785d;flex:0 0 auto;padding:0}
.gm-ink-yellow{background:#ffdf68!important}.gm-ink-green{background:#a4e4af!important}.gm-ink-blue{background:#addafb!important}.gm-ink-pink{background:#f5b9d5!important}
.gm-ink-menu .gm-ink-menu-actions button{border:1px solid #d9c494;background:#fff8e8;color:#463015;padding:6px;min-height:38px;font-size:12px;border-radius:8px;flex:1;white-space:nowrap}
.gm-ink-menu .gm-ink-menu-actions button:last-child{flex:0 0 39px}
.gm-ink-overlay{position:fixed;inset:0;z-index:680;background:#000b;display:flex;justify-content:center;align-items:center;padding:12px;overflow:auto;color:var(--gm-text)}
.gm-ink-dialog{background:var(--gm-card);color:var(--gm-text);width:min(620px,100%);max-height:95dvh;overflow-y:auto;border:1px solid var(--gm-gold);border-radius:18px;padding:17px;box-shadow:0 18px 52px #0008;direction:rtl}
.gm-ink-dialog-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.gm-ink-dialog-head h2{margin:0;font-size:21px;color:var(--gm-gold)}.gm-ink-dialog-head button{min-height:34px}
.gm-ink-dialog blockquote{background:var(--gm-bg);padding:10px 12px;border-radius:10px;margin:12px 0;max-height:130px;overflow-y:auto;border-right:4px solid var(--gm-gold);font-size:15px;white-space:pre-wrap}
.gm-ink-dialog label{font-size:14px;display:flex;flex-direction:column;gap:3px}
.gm-ink-dialog textarea{width:100%;padding:10px;border-radius:10px;border:1px solid var(--gm-border);color:var(--gm-text);background:var(--gm-bg);resize:vertical}
.gm-ink-reference-box{border:1px solid var(--gm-border);border-radius:12px;margin-top:13px;padding:10px}
.gm-ink-reference-box h3{font-size:16px;margin:0 0 7px;color:var(--gm-gold)}
.gm-ink-ref-fields{display:flex;flex-wrap:wrap;align-items:end;gap:6px}
.gm-ink-ref-fields select{max-width:145px;min-height:40px;color:var(--gm-text);background:var(--gm-bg);border:1px solid var(--gm-border);padding:5px;border-radius:8px}
.gm-ink-ref-fields button{min-height:40px}
.gm-ink-ref-item{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--gm-border)}
.gm-ink-ref-item a,.gm-ink-crosslink{color:var(--gm-gold);text-decoration:underline;font-weight:600}
.gm-ink-privacy{font-size:12px;opacity:.82;margin:11px 0 4px}
.gm-ink-dialog-actions,.gm-ink-share-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:14px;align-items:center}
.gm-ink-spacer{flex:1}.gm-ink-dialog-actions button{min-height:39px}
.gm-ink-notebook-controls{display:flex;align-items:center;flex-wrap:wrap;gap:15px;margin:12px 0}
.gm-ink-notebook-controls label{font-size:13px;display:flex;align-items:center;gap:6px}
.gm-ink-notebook-controls input[type=search]{min-height:39px;max-width:200px;border:1px solid var(--gm-border);background:var(--gm-bg);color:var(--gm-text);border-radius:8px;padding:7px}
.gm-ink-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:10px}
.gm-ink-list>p{grid-column:1/-1;opacity:.8}
.gm-ink-card{padding:12px;border:1px solid var(--gm-border);background:var(--gm-bg);border-radius:13px;min-width:0}
.gm-ink-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.gm-ink-card-head strong{font-size:14px;color:var(--gm-gold)}
.gm-ink-chip{height:18px;width:23px;border-radius:6px;border:1px solid #a18d69;flex-shrink:0}
.gm-ink-card blockquote{max-height:120px;overflow:auto;margin:8px 0;border-right:3px solid #b18b48;padding-right:10px;white-space:pre-wrap;font-size:14px}
.gm-ink-card>p{font-size:14px;white-space:pre-wrap}
.gm-ink-crosslink{display:block;margin:3px 0;font-size:13px}
.gm-ink-card-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px}
.gm-ink-card-tools button,.gm-ink-card-tools a{font-size:12px;min-height:33px;border:1px solid var(--gm-border);border-radius:7px;padding:5px 9px;text-decoration:none;color:var(--gm-text);background:var(--gm-card)}
.gm-ink-inbound{grid-column:1/-1;border:1px solid var(--gm-border);padding:12px;border-radius:12px}
.gm-ink-inbound h3{margin:0 0 8px}.gm-ink-inbound>a{display:block;color:var(--gm-gold);margin:3px 0}
.gm-ink-legacy{margin-top:13px;padding:11px;border:1px solid var(--gm-border);border-radius:10px}
.gm-ink-legacy summary{cursor:pointer;font-weight:bold;font-size:14px}
.gm-ink-share-actions button{flex:1}
@media(max-width:650px){.gm-ink-menu{width:min(350px,calc(100vw - 14px))}.gm-ink-dialog{padding:12px}.gm-ink-ref-fields select{max-width:125px}.gm-ink-dialog-actions button{flex:1}}
@media print{.gm-ink-menu,.gm-ink-overlay{display:none!important}}

.gm-ink-menu-extras{display:flex;gap:6px}.gm-ink-menu-extras button{flex:1;min-height:31px;padding:3px 5px;font-size:12px;border:1px solid #d9c494;background:#fff8e8;color:#463015}

/* 15.14.45: taps on text are accessible; long-press selection and pan/zoom remain native. */
.gm-p .gm-txt{cursor:text}

/* 15.14.46: independent page journal; accessible in dark, parchment and mobile modes. */
.gm-page-journal{margin:16px 0 22px;background:var(--gm-bg);border:1px solid var(--gm-border);border-radius:16px;overflow:hidden}
.gm-page-journal>summary{cursor:pointer;list-style:initial;padding:14px 17px;font-size:18px;font-weight:800;color:var(--gm-gold);background:var(--gm-card)}
.gm-page-journal .gm-journal-fold{float:left;font-size:12px;font-weight:400;color:var(--gm-text);opacity:.8}
.gm-journal-body{padding:14px 16px 17px;display:grid;gap:11px}
.gm-journal-body p{margin:0}
.gm-journal-subtitle{font-weight:800;font-size:17px!important;color:var(--gm-gold)}
.gm-journal-hint,.gm-journal-footnote{color:var(--gm-text);opacity:.83;font-size:13px!important}
.gm-journal-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}
.gm-journal-field{display:flex;flex-direction:column;gap:8px;min-width:0;font-size:15px}
.gm-journal-field strong{color:var(--gm-gold)}
.gm-journal-field textarea{width:100%;min-width:0;min-height:155px;resize:vertical;border-radius:12px;border:1px solid var(--gm-border);padding:13px;font:inherit;font-size:16px;line-height:1.8;color:var(--gm-text);background:var(--gm-card);direction:rtl;unicode-bidi:plaintext;outline-offset:2px}
.gm-journal-field textarea:focus-visible{outline:2px solid var(--gm-gold)}
.gm-journal-field textarea::placeholder{color:var(--gm-text);opacity:.65}
.gm-journal-status{font-size:13px!important;color:var(--gm-gold);min-height:20px}
.gm-journal-status.gm-journal-error{color:#f2a19b}
:root.gm-light .gm-journal-status.gm-journal-error{color:#ac2020}
.gm-journal-actions,.gm-journal-recent{display:flex;flex-wrap:wrap;gap:8px}
.gm-journal-actions button{flex:0 1 auto}
.gm-journal-actions .gm-journal-delete{margin-inline-start:auto}
.gm-journal-history{border-top:1px solid var(--gm-border);padding-top:9px}
.gm-journal-history summary{cursor:pointer;font-size:14px;font-weight:700}
.gm-journal-recent{margin-top:11px;font-size:13px;align-items:center}
.gm-journal-recent-item{padding:7px 10px;min-height:36px;font-size:13px}
.gm-journal-recent-item:disabled{opacity:.65;cursor:default}
@media(max-width:720px){.gm-journal-fields{grid-template-columns:1fr}.gm-page-journal>summary{font-size:16px}.gm-journal-body{padding:12px}.gm-journal-actions{display:grid;grid-template-columns:1fr 1fr}.gm-journal-actions button{width:100%}.gm-journal-actions .gm-journal-delete{grid-column:1/-1;margin:0}}

/* 15.14.46: explicit whole-paragraph picker. Ordinary reading taps remain passive. */
.gm-options #gmPickParagraph{white-space:nowrap;border:1px solid var(--gm-gold);font-weight:700}
.gm-options #gmPickParagraph.gm-pick-active{background:#f2d789;color:#35250f;outline:2px solid #ad8339;outline-offset:1px}
:root.gm-light .gm-options #gmPickParagraph.gm-pick-active{background:#ad7b20;color:#fffaf0}
.gm-pick-hint{margin:6px 9px 0;padding:9px 12px;border:1px solid var(--gm-gold);background:var(--gm-card);border-radius:9px;color:var(--gm-text);font-size:13px}
.gm-pick-hint[hidden]{display:none!important}
.gm-pick-mode .gm-p .gm-txt{cursor:crosshair;outline-offset:2px}
.gm-pick-mode .gm-p:hover .gm-txt{outline:1px dashed var(--gm-gold);background:color-mix(in srgb,var(--gm-gold) 12%,transparent)}
@media print{.gm-pick-hint{display:none!important}}

/* v15.14.47 — Keep scroll and pinch zoom, suppress accidental native double-tap zoom on inline words. */
.gm-p .gm-txt{touch-action:manipulation}


/* 15.14.48: compact page notebook; preserves existing entry ids and localStorage data. */
.gm-notebook{padding:10px 12px;margin-top:15px;display:grid;gap:9px}
.gm-page-journal{margin:0;background:transparent;border:1px solid var(--gm-border);border-radius:16px;overflow:visible}
.gm-page-journal>.gm-journal-summary{display:flex;gap:9px;align-items:center;flex-wrap:wrap;padding:13px 15px;list-style:none;background:var(--gm-card);border-radius:16px;color:var(--gm-text)}
.gm-page-journal>.gm-journal-summary::-webkit-details-marker{display:none}
.gm-journal-title{font-size:19px;font-weight:800;color:var(--gm-gold)}
.gm-journal-location{font-size:13px;opacity:.88;flex:1;min-width:125px}
.gm-journal-badge{font-size:12px;color:var(--gm-gold);border:1px solid var(--gm-border);border-radius:999px;padding:3px 9px}
.gm-journal-chevron{font-size:23px;line-height:1;transition:transform .2s}
.gm-page-journal[open] .gm-journal-chevron{transform:rotate(180deg)}
.gm-journal-body{padding:12px;display:grid;gap:9px}
.gm-journal-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;border:1px solid var(--gm-border);border-radius:13px;background:var(--gm-bg)}
.gm-journal-tabs .gm-journal-tab{border:0;min-height:42px;padding:7px 3px;font-size:15px;font-weight:700;background:transparent;color:var(--gm-text);border-radius:9px}
.gm-journal-tabs .gm-journal-tab[aria-selected=true]{background:#efd18b;color:#34240f;box-shadow:0 1px 5px #0002}
.gm-journal-panel[hidden]{display:none!important}
.gm-journal-field{gap:4px;font-size:14px}
.gm-journal-field textarea{width:100%;min-height:114px;max-height:480px;padding:11px 12px;line-height:1.7;background:var(--gm-card);font-size:16px;resize:none;overflow-y:hidden}
.gm-journal-field textarea:focus{outline:2px solid var(--gm-gold)}
.gm-journal-panel{min-width:0}
.gm-journal-panel p.gm-journal-hint{font-size:12px!important;margin:5px 2px 0}
.gm-journal-archive-label{display:block;font-size:13px;margin-bottom:5px}
#gmJournalArchiveSearch{width:100%;min-height:43px;border:1px solid var(--gm-border);border-radius:10px;background:var(--gm-card);color:var(--gm-text);font-size:15px;padding:8px 10px}
.gm-journal-recent{max-height:360px;overflow-y:auto;display:grid;gap:7px;margin-top:10px}
.gm-journal-recent-item{min-height:65px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;text-align:right;background:var(--gm-card);color:var(--gm-text);padding:10px;border:1px solid var(--gm-border);border-radius:10px;width:100%}
.gm-journal-recent-item strong{font-size:14px;color:var(--gm-gold)}
.gm-journal-recent-item small{font-size:12px;opacity:.75;white-space:nowrap}
.gm-journal-recent-item span{grid-column:1/-1;font-size:13px;opacity:.88;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gm-journal-status{margin:0!important;min-height:18px;font-size:12px!important}
.gm-journal-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.gm-journal-actions>button,.gm-journal-more>summary{width:100%;min-height:40px;padding:7px 4px;border-radius:9px;font-size:13px;white-space:nowrap;text-align:center}
.gm-journal-more{position:relative;min-width:0}
.gm-journal-more>summary{list-style:none;display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid var(--gm-border);background:var(--gm-card);color:var(--gm-text)}
.gm-journal-more>summary::-webkit-details-marker{display:none}
.gm-journal-more-content{position:absolute;z-index:15;left:0;bottom:calc(100% + 5px);min-width:220px;padding:7px;background:var(--gm-card);border:1px solid var(--gm-border);border-radius:10px;box-shadow:0 8px 22px #0004}
.gm-journal-more-content .gm-journal-delete{font-size:13px;white-space:normal;width:100%;color:var(--gm-text)}
.gm-journal-footnote{font-size:11px!important;opacity:.8;margin:0!important}
.gm-ink-saved{border:1px solid var(--gm-border);border-radius:12px;background:var(--gm-bg)}
.gm-ink-saved>summary{list-style:none;cursor:pointer;padding:11px 13px;font-weight:700;color:var(--gm-gold);font-size:14px}
.gm-ink-saved>summary::-webkit-details-marker{display:none}
.gm-ink-saved-hint{font-size:11px;font-weight:400;opacity:.8;color:var(--gm-text);float:left}
.gm-ink-saved-body{padding:10px;border-top:1px solid var(--gm-border)}
.gm-ink-menu-extras{flex-wrap:wrap}.gm-ink-menu-extras button{flex:1 1 31%;white-space:normal;min-height:36px}
@media(max-width:620px){
 .gm-notebook{padding:8px;gap:8px}
 .gm-page-journal>.gm-journal-summary{padding:12px;gap:6px}
 .gm-journal-title{font-size:17px;flex-basis:100%}
 .gm-journal-location{min-width:0;font-size:12px}
 .gm-journal-body{padding:9px}
 .gm-journal-tabs .gm-journal-tab{font-size:13px;padding:7px 2px}
 .gm-journal-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 .gm-journal-actions>button,.gm-journal-more>summary{font-size:12px;padding:6px 2px;min-height:40px}
 .gm-journal-more-content{min-width:205px}
}
@media print{.gm-page-journal,.gm-ink-saved{display:none!important}}

/* 15.14.51 — licensed classical marginalia index; outside the scaled Vilna folio. */
.gm-sources{margin:10px auto 12px;max-width:990px;direction:rtl;color:var(--gm-ink,#f0e3ca)}
.gm-sources-disclosure{border:1px solid #ad86566b;border-radius:14px;background:rgba(132,107,66,.09);overflow:hidden}
.gm-sources-disclosure>summary{cursor:pointer;display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;justify-content:space-between;padding:11px 14px;font-weight:800;list-style:none}
.gm-sources-disclosure>summary::-webkit-details-marker{display:none}
.gm-sources-disclosure>summary::after{content:'⌄';margin-inline-start:auto}
.gm-sources-disclosure[open]>summary::after{content:'⌃'}
#gmSourcesTotal{font-size:12px;font-weight:500;opacity:.78}
.gm-sources-body{padding:10px 12px 14px;border-top:1px solid #ad865630}
.gm-sources-explain{font-size:12px;line-height:1.7;margin:0 0 9px}
.gm-source-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px}
.gm-source-tabs button{flex:0 1 auto;min-height:34px;padding:5px 11px;border:1px solid #ad865694;border-radius:99px;background:transparent;color:inherit;font:inherit;font-size:12px}
.gm-source-tabs button[aria-pressed=true]{background:#ab854b;color:#15100b;border-color:#ab854b;font-weight:800}
.gm-source-details{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:8px}
.gm-source-line{border:1px solid #ad865644;border-radius:10px;padding:11px;background:rgba(127,101,64,.07);min-width:0}
.gm-source-line strong{font-size:13px;display:block}
.gm-source-line p{font-size:12px;line-height:1.6;margin:5px 0;color:inherit;opacity:.82;overflow-wrap:anywhere}
.gm-source-line a{font-size:12px;color:inherit;text-decoration:underline;display:inline-block;margin-top:3px}
.gm-rail-entry[hidden]{display:none!important}
@media print{.gm-sources{display:none!important}}
/* Strong text contrast in both saved reading themes. --gm-ink is for the paper, not cards. */
.gm-sources{color:var(--gm-text)}
.gm-sources-disclosure{background:var(--gm-card);border-color:var(--gm-border)}
.gm-source-line{background:var(--gm-bg);border-color:var(--gm-border)}
.gm-source-tabs button{color:var(--gm-text);border-color:var(--gm-border)}
.gm-source-tabs button[aria-pressed=true]{color:#241705;background:#f0cf88;border-color:#ddad5f}
.gm-source-line a{color:var(--gm-gold)}
:root.gm-light .gm-sources-disclosure{background:#fff9ec;color:#352515;border-color:#bea575}
:root.gm-light .gm-source-line{background:#fcf1db;color:#352515;border-color:#b99b61}
:root.gm-light .gm-source-tabs button:not([aria-pressed=true]){background:#f5e7c8;color:#352515;border-color:#b99b61}
:root.gm-light .gm-source-line a{color:#73460e}

/* 15.14.51: optional complete marginalia without overcrowding the reading surface */
.gm-margin-more{display:block;margin:6px auto 12px;padding:7px 16px;border-radius:999px;background:#f5eacb;color:#5d421a;border:1px solid #c7a76a;font-size:13px;font-weight:700;cursor:pointer}
.gm-margin-more[hidden]{display:none!important}

/* 15.14.51 — the existing licensed-marginalia view is available INSIDE
   the immersive folio. No extra queries or duplicate content databases. */
#gmSources[hidden]{display:none!important}
.gm-fs-sources-close,.gm-fs-sources-list,.gm-fs-sources-more{display:none}
.gm-paper-scroller.gm-fs-active #gmSources.gm-sources-in-fullscreen{
 position:fixed!important;z-index:30!important;
 top:calc(61px + env(safe-area-inset-top,0px));bottom:calc(10px + env(safe-area-inset-bottom,0px));
 right:calc(10px + env(safe-area-inset-right,0px));left:calc(10px + env(safe-area-inset-left,0px));
 margin:0 auto!important;width:auto!important;max-width:840px!important;
 background:var(--gm-card)!important;color:var(--gm-text)!important;
 border:1px solid var(--gm-border);border-radius:15px;padding:10px;
 box-shadow:0 18px 60px #000b;overflow:auto!important;overscroll-behavior:contain;
 direction:rtl;transform:none!important;
}
.gm-paper-scroller.gm-fs-active #gmSources .gm-fs-sources-close{
 display:block;position:sticky;top:0;z-index:3;margin:0 0 7px auto;
 background:#edcf91;color:#25180d;border:1px solid #bd984e;font-weight:800;min-height:42px;
}
.gm-paper-scroller.gm-fs-active #gmSources .gm-fs-sources-list{display:block;padding:9px 0 4px}
.gm-fs-source-group{margin:0 0 14px;border-top:1px solid var(--gm-border);padding:8px 0 0}
.gm-fs-source-group>h3{margin:0 0 8px;color:var(--gm-gold);font-size:16px}
.gm-fs-source-entry{background:var(--gm-bg);color:var(--gm-text);border:1px solid var(--gm-border);border-radius:9px;margin:6px 0;padding:8px}
.gm-fs-source-entry button{width:100%;display:block;text-align:right;white-space:normal;font-size:15px;line-height:1.55;border:0;padding:5px 2px;min-height:32px;background:transparent;color:inherit}
.gm-fs-source-entry .gm-fs-source-meta{font-size:11px;color:var(--gm-gold);opacity:.94;display:block}
.gm-paper-scroller.gm-fs-active #gmSources .gm-fs-sources-more:not([hidden]){display:block;margin:8px auto;padding:8px 16px}
.gm-paper-scroller.gm-fs-active #gmMarginDialog:not([hidden]){z-index:75}
@media(max-width:650px){
 .gm-paper-scroller.gm-fs-active #gmFullscreenText{display:none}
 .gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar{gap:5px;justify-content:space-between;padding:5px}
 .gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar button{font-size:12px;padding:5px 7px;min-width:0;white-space:normal}
 .gm-paper-scroller.gm-fs-active #gmSources.gm-sources-in-fullscreen{top:calc(57px + env(safe-area-inset-top,0px));}
}
@media print{.gm-fs-sources-close,.gm-fs-sources-list,.gm-fs-sources-more{display:none!important}}

/* 15.14.54 — each commentary has its own named reading section.
   Small index cards in "all"; the selected commentary opens a full reading
   pane.  This uses the same source payload as the folio + fullscreen. */
.gm-source-details[data-selected="false"]{grid-template-columns:repeat(auto-fit,minmax(min(100%,205px),1fr))}
.gm-source-details[data-selected="true"]{display:flex;flex-direction:column;gap:10px}
.gm-source-independent{padding:0;overflow:hidden}
.gm-source-open{width:100%;min-height:60px;padding:12px;display:flex;align-items:center;justify-content:space-between;gap:10px;border:0;text-align:right;background:transparent;color:inherit;font:inherit;cursor:pointer}
.gm-source-open strong{font-size:15px;line-height:1.4}
.gm-source-state{font-size:11px;white-space:normal;color:var(--gm-gold);flex:0 0 auto;max-width:45%;text-align:left}
.gm-source-details[data-selected="true"] .gm-source-independent{padding:11px}
.gm-source-details[data-selected="true"] .gm-source-open{padding:4px 0 10px;min-height:44px;border-bottom:1px solid var(--gm-border)}
.gm-source-details[data-selected="true"] .gm-source-open strong{font-size:20px}
.gm-source-back,.gm-source-read-more{align-self:flex-start;padding:9px 14px;border:1px solid var(--gm-border);background:var(--gm-bg);color:var(--gm-text);border-radius:11px;font-weight:800;cursor:pointer}
.gm-source-read-more{margin:9px auto 0;display:block}
.gm-source-reading{display:grid;grid-template-columns:1fr;gap:7px;margin:11px 0 0}
.gm-source-reading-item{font:inherit;font-size:15px;line-height:1.6;text-align:right;direction:rtl;white-space:normal;overflow-wrap:anywhere;background:var(--gm-bg);color:var(--gm-text);border:1px solid var(--gm-border);border-radius:9px;min-height:42px;padding:10px 12px;cursor:pointer}
.gm-source-reading-item:hover,.gm-source-open:hover{background:rgba(206,170,104,.12)}
.gm-source-reading-item:focus-visible,.gm-source-open:focus-visible{outline:2px solid var(--gm-gold);outline-offset:2px}
/* Fullscreen already presents the selected texts in its existing reader;
   avoid duplicate text entries while preserving named source index/cards. */
.gm-paper-scroller.gm-fs-active #gmSources .gm-source-reading,.gm-paper-scroller.gm-fs-active #gmSources .gm-source-read-more{display:none!important}
@media(max-width:600px){.gm-source-details[data-selected="false"]{grid-template-columns:repeat(2,minmax(0,1fr))}.gm-source-open{align-items:start;flex-direction:column;gap:5px}.gm-source-state{max-width:100%;text-align:right}.gm-source-details[data-selected="true"] .gm-source-open{flex-direction:row;align-items:center}}

/* 15.14.55 — preserve the ORIGINAL ink, note and share tools in fullscreen.
   The fullscreen folio is a high-z stacking context: body-level overlays
   cannot appear above it. JS moves their existing DOM nodes into the folio. */
.gm-paper-scroller.gm-fs-active > #gmInkMenu:not([hidden]){position:fixed!important;z-index:650!important}
.gm-paper-scroller.gm-fs-active > #gmInkEditor:not([hidden]),
.gm-paper-scroller.gm-fs-active > #gmInkShare:not([hidden]){position:fixed!important;z-index:690!important}
.gm-paper-scroller.gm-fs-active > #gmNoteDialog:not([hidden]){position:fixed!important;z-index:690!important}
.gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar #gmFullscreenPickParagraph[aria-pressed="true"]{
 background:#f0d48b;color:#30200e;outline:2px solid #fff0b9;outline-offset:1px;
}
@media(max-width:650px){
 .gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar{flex-wrap:wrap}
 .gm-paper-scroller.gm-fs-active .gm-fullscreen-toolbar #gmFullscreenPickParagraph{
  order:5;flex:1 1 100%;min-height:39px;font-size:13px;
 }
 .gm-paper-scroller.gm-fs-active #gmSources.gm-sources-in-fullscreen{top:calc(108px + env(safe-area-inset-top,0px))}
}

/* 15.14.56 — explicit recovery when the licensed source endpoint is slow. */
.gm-fs-sources-list .gm-sources-retry{display:block;width:100%;min-height:42px;margin-top:12px;background:#f4d995;color:#2b1b0b;border:1px solid #b4924f;border-radius:10px;font-weight:700}

/* 15.14.61 — strict ink-on-paper rails in fullscreen, portrait fit and pan.
   Rail overflow scrolls INSIDE the folio instead of painting below its border.
   Notes stay in their original DOM and all 22 licensed-source tabs are intact. */
.gm-folio-body{min-width:0;max-width:100%}
.gm-folio-margin{min-height:0!important;min-width:0;overflow:hidden}
.gm-rail-notes{
 min-height:0!important;max-width:100%;
 overflow-x:hidden;overflow-y:auto;
 overscroll-behavior-y:contain;
 scrollbar-width:thin;scrollbar-color:#b19a71 #f6ecd6;
}
.gm-rail-notes.gm-rail-scrollable{
 border-bottom:2px solid #b8a175;
}
.gm-rail-notes:focus-visible{outline:2px solid #a07836;outline-offset:-2px}
@media print{
 .gm-rail-notes{overflow:hidden!important}
}

/* 15.14.61: true Gemara-segment pins; no unverified notes stacked at folio end. */
.gm-rail-pin{display:block!important;text-align:right!important;font-family:"Noto Serif Hebrew","David",serif!important;font-size:9px!important;font-weight:700!important;line-height:1.35!important;min-height:22px!important;max-height:44px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:normal!important;background:#f7ebcd!important;border:1px solid #c5ad83!important;border-inline-start:3px solid #916d35!important;border-radius:3px!important;color:#402a10!important;padding:2px 3px!important;box-shadow:none!important;cursor:pointer}
.gm-rail-pin:hover,.gm-rail-pin:focus-visible{background:#ead4a4!important;outline:1px solid #996f39!important}
.gm-verified-choice{display:block;width:100%;padding:8px 10px!important;margin:4px 0!important;text-align:right!important;white-space:normal!important;line-height:1.65!important;font-size:14px!important;background:transparent!important;border:1px solid #c3ab84!important;color:var(--gm-text)!important}
.gm-verified-choice:hover,.gm-verified-choice:focus-visible{background:rgba(197,164,95,.14)!important}
::highlight(gm-linked-dibbur){background:#edc848;color:#231c0c;text-decoration:underline}

/* 15.14.61 — verified commentary marks are reading guidance, not saved ink. */
#gmMain .gm-p.gm-apparatus-focus,
.gm-sheet #gmMain .gm-p.gm-apparatus-focus{
 background:rgba(250,204,65,.52)!important;
 outline:3px solid #a76f12!important;
 outline-offset:2px;border-radius:4px;
 box-shadow:inset 0 0 0 1px rgba(118,76,15,.55);
}
::highlight(gm-linked-dibbur){background:#f5c82b!important;color:#1f180a!important;text-decoration:underline 2px #ad4f00!important}
.gm-source-details[data-selected="false"]{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}
.gm-source-details[data-selected="false"] .gm-source-independent{padding:10px;min-width:0}
.gm-source-details[data-selected="false"] .gm-source-open{min-height:42px;padding:4px 2px 8px;border-bottom:1px solid var(--gm-border)}
.gm-source-details[data-selected="false"] .gm-source-reading-item{font-size:13px;line-height:1.55;padding:6px 9px;min-height:32px}
@media(max-width:600px){.gm-source-details[data-selected="false"]{grid-template-columns:1fr}}

/* 15.14.73: Talmud selector; same print-like renderer for both corpora. */
.gm-corpus-tabs{display:flex;gap:9px;flex-wrap:wrap;margin:0 0 13px}.gm-corpus-tabs a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:7px 20px;color:var(--gm-gold);text-decoration:none;border:1px solid var(--gm-border);border-radius:12px;background:var(--gm-card);font-weight:800}.gm-corpus-tabs a[aria-current="page"]{color:#2e2111;background:#f0d08b;border-color:#e3bc63}.gm-yerushalmi .gm-folio-margin,.gm-yerushalmi #gmMarginKey,.gm-yerushalmi #gmMarginMore{display:none!important}.gm-yerushalmi .gm-folio-body{grid-template-columns:minmax(0,1fr)!important}.gm-yerushalmi .gm-folio-content{grid-column:1!important;min-width:0}.gm-yerushalmi .gm-sheet-head .gm-folio-meta{line-height:1.2}.gm-yerushalmi .gm-source-details{display:none}#gmDafYomi[hidden],#gmSources[hidden]{display:none!important}

/* 15.14.73: Yerushalmi commentaries only if present. No empty slot or banner. */
.gm-yerushalmi .gm-sheet.gm-y-no-rashi .gm-daf-grid .gm-rashi,
.gm-yerushalmi .gm-sheet.gm-y-no-tosafot .gm-daf-grid .gm-tosafot{display:none!important}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-no-tosafot:not(.gm-y-no-rashi) .gm-daf-grid{
 display:grid!important;grid-template-columns:32% minmax(0,1fr)!important;gap:2%;}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-no-tosafot:not(.gm-y-no-rashi) .gm-daf-grid .gm-rashi{grid-column:1;grid-row:1;width:100%!important;float:none!important}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-no-tosafot:not(.gm-y-no-rashi) .gm-daf-grid .gm-gemara{grid-column:2;grid-row:1;float:none!important}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-no-rashi:not(.gm-y-no-tosafot) .gm-daf-grid{
 display:grid!important;grid-template-columns:minmax(0,1fr) 32%!important;gap:2%;}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-no-rashi:not(.gm-y-no-tosafot) .gm-daf-grid .gm-gemara{grid-column:1;grid-row:1;float:none!important}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-no-rashi:not(.gm-y-no-tosafot) .gm-daf-grid .gm-tosafot{grid-column:2;grid-row:1;width:100%!important;float:none!important}
.gm-yerushalmi .gm-sheet.gm-y-no-rashi.gm-y-no-tosafot .gm-daf-grid{display:block!important;min-height:0!important}
.gm-yerushalmi .gm-sheet.gm-y-no-rashi.gm-y-no-tosafot .gm-daf-grid .gm-gemara{float:none!important;width:100%!important;max-width:100%!important}
.gm-yerushalmi .gm-sheet.gm-y-no-rashi .gm-wide-rashi,
.gm-yerushalmi .gm-sheet.gm-y-no-tosafot .gm-wide-tosafot{display:none!important}
.gm-yerushalmi .gm-sheet.gm-y-no-rashi .gm-daf-continued:not([hidden]){grid-template-columns:1fr!important}
.gm-yerushalmi .gm-sheet.gm-y-no-tosafot .gm-daf-continued:not([hidden]){grid-template-columns:1fr!important}
.gm-yerushalmi .gm-sheet.gm-y-no-rashi .gm-single-continued.gm-full-rashi,
.gm-yerushalmi .gm-sheet.gm-y-no-tosafot .gm-single-continued.gm-full-tosafot{display:none!important}
.gm-y-extras[hidden]{display:none!important}
.gm-y-extras{background:linear-gradient(140deg,#fff6dc,#f7ead0);color:#352714;border:1px solid #ba975a;border-radius:12px;padding:20px;margin:14px 0;direction:rtl}
.gm-y-extras h2{font-size:23px;color:#49341a;margin:0 0 12px}
.gm-y-extra-tabs{display:flex;flex-wrap:wrap;gap:8px}
.gm-y-extra-tabs button{font-size:15px;min-height:40px;background:#f7eccf;color:#372719;border:1px solid #ac884b;border-radius:9px;padding:7px 12px;cursor:pointer}
.gm-y-extra-tabs button[aria-pressed="true"]{background:#64461f;color:#fff3d4}
.gm-y-extra-reading{margin-top:15px;border-top:1px solid #c7b38e;padding-top:10px}
.gm-y-extra-reading h3{font-size:21px;margin:0 0 5px}
.gm-y-extra-credit{color:#5d513c;font-size:13px;margin:0 0 7px}
.gm-y-extra-reading a{color:#644d23;font-size:14px;display:inline-block;margin-bottom:8px}
.gm-y-extra-item{border-bottom:1px solid #d7c8a9;padding:9px 0}
.gm-y-extra-item p{font-family:"Noto Serif Hebrew","David",serif;font-size:clamp(17px,2.5vw,21px);line-height:1.75;white-space:pre-wrap;text-align:justify;overflow-wrap:break-word;margin:0 0 6px}
.gm-y-extra-item button{font-size:13px;min-height:35px;background:#ecdfbc;color:#453016;border:1px solid #a98c54;border-radius:8px;padding:4px 10px}
@media(max-width:480px){.gm-y-extras{padding:12px;margin:10px 0}.gm-y-extras h2{font-size:20px}.gm-y-extra-tabs button{font-size:14px}}

.gm-yerushalmi #gmFullscreenSourcesToggle{display:none!important}

/* 15.14.73 — all AVAILABLE and LICENSED Yerushalmi commentaries in the
   actual two outer folio rails; no separate panels, no empty columns.
   Same paper / fit-to-screen surface as the Bavli.  No segment anchors
   are inferred from a shared chapter/halakhah source reference. */
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-body{
  display:grid!important;grid-template-columns:minmax(106px,15%) minmax(0,1fr) minmax(106px,15%)!important;
  gap:5px;align-items:stretch!important;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-content{grid-column:2!important;min-width:0}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-margin{
  display:block!important;min-width:0!important;min-height:0!important;height:100%;position:relative;
  padding:0 4px;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-margin-right{grid-column:1}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-margin-left{grid-column:3}
.gm-yerushalmi .gm-sheet .gm-y-margin-stack[hidden]{display:none!important}
.gm-yerushalmi .gm-sheet .gm-y-margin-stack{
  position:absolute;inset-inline:0;top:0;height:var(--gm-y-rail-height,620px);
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:#ac946e #f6edda;
  color:#3f301d;font-family:"Noto Serif Hebrew","David",serif;
}
.gm-yerushalmi .gm-sheet .gm-y-margin-label{
  position:sticky;top:0;z-index:1;text-align:center;display:block;
  font-size:11px;font-weight:800;line-height:1.35;color:#533e25;
  background:var(--gm-paper,#fff5dc);border-bottom:2px double #937d5c;
  padding:3px 0 5px;
}
.gm-yerushalmi .gm-sheet .gm-y-rail-item{
  border-bottom:1px solid #ccb99d;padding:7px 2px 8px;overflow-wrap:anywhere;
}
.gm-yerushalmi .gm-sheet .gm-y-rail-item button{
  display:block;text-align:right;direction:rtl;width:100%;min-height:0;
  font-size:12px;line-height:1.35;color:#3e2818;background:transparent;
  padding:1px 0;border:0;border-radius:2px;white-space:normal;
}
.gm-yerushalmi .gm-sheet .gm-y-rail-item button:hover,
.gm-yerushalmi .gm-sheet .gm-y-rail-item button:focus-visible{background:#e9d6aa;outline:1px solid #a58958}
.gm-yerushalmi .gm-sheet .gm-y-rail-name{display:block;font-size:12px;line-height:1.3;font-weight:800;word-break:break-word}
.gm-yerushalmi .gm-sheet .gm-y-rail-excerpt{
  display:-webkit-box;-webkit-line-clamp:6;line-clamp:6;-webkit-box-orient:vertical;
  overflow:hidden;text-overflow:ellipsis;max-height:9em;
  font-size:11px;line-height:1.47;font-weight:400;
}
.gm-yerushalmi .gm-sheet .gm-y-rail-more{font-size:10px;color:#765324;display:block;margin-top:2px}
.gm-yerushalmi .gm-sheet.gm-focus .gm-y-margin-stack{display:none!important}
/* Simple source details in the existing margin dialog, not a separate section. */
.gm-y-dialog-paragraph{white-space:pre-wrap;font-family:"Noto Serif Hebrew","David",serif;font-size:16px;line-height:1.7;text-align:right;padding:8px 0;border-bottom:1px solid #bfa889}
.gm-y-dialog-paragraph button{margin-top:7px;min-height:30px;font-size:12px;padding:3px 7px}
.gm-y-dialog-intro{font-size:13px;line-height:1.4;margin-bottom:8px}
@media(max-width:920px){
 .gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-body{grid-template-columns:110px minmax(0,1fr) 110px!important}
}
@media print{
 .gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-margin-stack{position:static!important;height:auto!important;overflow:visible!important}
}

/* 15.14.73 — Pnei Moshe flows right-to-left A then B when Korban HaEdah
   does not exist for the current halakhah. No fake commentary or blank slot. */
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double:not(.gm-focus) .gm-daf-grid{
 display:grid!important;grid-template-columns:24% minmax(0,1fr) 24%!important;gap:1.25%!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double:not(.gm-focus) .gm-daf-grid .gm-rashi{
 display:block!important;grid-column:1!important;grid-row:1!important;float:none!important;width:auto!important;margin:0!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double:not(.gm-focus) .gm-daf-grid .gm-gemara{
 display:block!important;grid-column:2!important;grid-row:1!important;float:none!important;width:auto!important;margin:0!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double:not(.gm-focus) .gm-daf-grid .gm-tosafot{
 display:block!important;grid-column:3!important;grid-row:1!important;float:none!important;width:auto!important;margin:0!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double:not(.gm-focus) .gm-daf-continued:not([hidden]):not(.gm-only-rashi):not(.gm-only-tosafot){
 display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
}
.gm-yerushalmi .gm-sheet.gm-y-pnei-double:not(.gm-focus) .gm-daf-continued:not(.gm-only-rashi) .gm-wide-tosafot{
 display:block!important;
}
.gm-yerushalmi .gm-sheet.gm-y-pnei-double:not(.gm-focus) .gm-single-continued.gm-full-rashi{
 display:block!important;
}

/* 15.14.73 — three consistent site-wide themes for BOTH Talmuds.
   Palette follows the same `krTheme` key as /index.html (dark / cream / parchment).
   Does not change source text, ink, fonts, page geometry, or pagination. */
:root{
 --gm-bg:#090806;--gm-card:#11100d;--gm-text:#f6f0dc;--gm-gold:#e8c45d;
 --gm-border:rgba(230,190,82,.30);--gm-ui-paper:#211a10;
 --gm-paper:#fff6df;--gm-ink:#30271b;--gm-shell-btn-bg:#17130d;--gm-shell-btn-fg:#f6f0dc;
 --gm-comment-panel:#17130c;--gm-comment-title:#efcc79;--gm-comment-muted:#cdb88c;
 --gm-comment-card:#fff3d8;--gm-comment-card-ink:#342515;--gm-comment-line:#c5ab77;
 color-scheme:dark;
}
:root[data-kr-theme="cream"]{
 --gm-bg:#f7f2e8;--gm-card:#fffdf8;--gm-text:#3e2c1b;--gm-gold:#81591c;
 --gm-border:rgba(156,111,40,.35);--gm-ui-paper:#f7eddc;
 --gm-paper:#fffdf2;--gm-ink:#302417;--gm-shell-btn-bg:#fff8e9;--gm-shell-btn-fg:#3e2c1b;
 --gm-comment-panel:#fffdf8;--gm-comment-title:#81591c;--gm-comment-muted:#725b41;
 --gm-comment-card:#fff9ed;--gm-comment-card-ink:#392918;--gm-comment-line:#b7a17b;
 color-scheme:light;
}
:root[data-kr-theme="parchment"]{
 --gm-bg:#dfc48c;--gm-card:#f1ddb0;--gm-text:#392514;--gm-gold:#754810;
 --gm-border:rgba(112,73,24,.40);--gm-ui-paper:#e7cc96;
 --gm-paper:#f5e4bc;--gm-ink:#342416;--gm-shell-btn-bg:#f5e4bc;--gm-shell-btn-fg:#392514;
 --gm-comment-panel:#ead3a1;--gm-comment-title:#694318;--gm-comment-muted:#705331;
 --gm-comment-card:#f5e4bc;--gm-comment-card-ink:#392514;--gm-comment-line:#b09562;
 color-scheme:light;
}
:root[data-kr-theme="cream"] body,:root[data-kr-theme="parchment"] body,
:root:not([data-kr-theme]) body{background:var(--gm-bg);color:var(--gm-text)}
.gm-top,.gm-controls,.gm-options,.gm-notice,.gm-notebook,.gm-modal-dialog,
.gm-daily,.gm-sources,.gm-ink-menu,.gm-ribbon,.gm-yerushalmi .gm-y-below{
 border-color:var(--gm-border);color:var(--gm-text);
}
.gm-top,.gm-controls,.gm-options,.gm-notice,.gm-notebook,.gm-modal-dialog,.gm-daily,.gm-sources{
 background:var(--gm-card);
}
.gm-top .gm-back,.gm-brand h1,.gm-ribbon #gmLocation,.gm-notebook h2,
.gm-yerushalmi .gm-y-below h2,.gm-yerushalmi .gm-y-below-extras h3{
 color:var(--gm-gold);
}
.gm-controls button:not(.gm-primary):not(.selected),.gm-options button:not(.gm-primary):not(.selected),
.gm-header-tools button,.gm-field select,.gm-search input{
 border-color:var(--gm-border);background:var(--gm-shell-btn-bg);color:var(--gm-shell-btn-fg);
}
.gm-sheet{background:var(--gm-paper);color:var(--gm-ink);border-color:color-mix(in srgb,var(--gm-border) 90%,#80501b 10%)}
.gm-sheet .gm-column,.gm-sheet .gm-paragraphs,.gm-sheet .gm-sheet-head{color:var(--gm-ink)}
.gm-yerushalmi .gm-y-below{background:var(--gm-comment-panel);color:var(--gm-text);border-color:var(--gm-border)}
.gm-yerushalmi .gm-y-below-intro{color:var(--gm-comment-muted)}
.gm-yerushalmi .gm-y-below-primary .gm-column,
.gm-yerushalmi .gm-y-below-card{
 background:var(--gm-comment-card);color:var(--gm-comment-card-ink);border-color:var(--gm-comment-line);
}
.gm-yerushalmi .gm-y-below-card h4,.gm-yerushalmi .gm-y-below-primary .gm-column h2{color:var(--gm-comment-card-ink)}
@media print{
 :root[data-kr-theme] .gm-sheet{background:#fffdf2;color:#222;border-color:#555}
 .gm-yerushalmi .gm-y-below{background:white;color:#222}
}

/* 15.14.73 — restore compact single folio for the Yerushalmi.
   Prior 15.14.69 full-width patch was broken by stacked selectors, leaving
   the Gemara in a thin right column. Limit these overrides to Yerushalmi.
   Pnei Moshe/Korban HaEdah are INSIDE the page; further sources stay below. */
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-folio-body{
 display:block!important;width:100%!important;min-width:0!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-folio-content{
 display:block!important;width:100%!important;min-width:0!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-grid,
.gm-yerushalmi .gm-sheet.gm-y-pnei-double:not(.gm-focus) .gm-daf-grid,
.gm-yerushalmi .gm-sheet.gm-y-no-tosafot:not(.gm-focus) .gm-daf-grid{
 display:grid!important;grid-template-columns:17% minmax(0,1fr) 17%!important;
 gap:1%!important;align-items:start!important;direction:rtl!important;
 width:100%!important;min-height:0!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-rashi,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-grid .gm-rashi{
 display:block!important;grid-column:1!important;grid-row:1!important;
 float:none!important;width:100%!important;min-width:0!important;
 margin:0!important;padding:0 4px!important;border:0!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-gemara,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-grid .gm-gemara{
 display:block!important;grid-column:2!important;grid-row:1!important;
 float:none!important;width:100%!important;min-width:0!important;max-width:none!important;
 margin:0!important;padding:0 6px!important;border:0!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-tosafot,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-grid .gm-tosafot{
 display:block!important;grid-column:3!important;grid-row:1!important;
 float:none!important;width:100%!important;min-width:0!important;
 margin:0!important;padding:0 4px!important;border:0!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-tosafot:not(.gm-y-pnei-double) .gm-daf-grid{
 grid-template-columns:20% minmax(0,1fr)!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-tosafot:not(.gm-y-pnei-double) .gm-daf-grid .gm-tosafot{display:none!important}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-rashi .gm-daf-grid{
 grid-template-columns:minmax(0,1fr) 20%!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-rashi .gm-daf-grid .gm-rashi{display:none!important}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-rashi .gm-daf-grid .gm-gemara{grid-column:1!important}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-rashi .gm-daf-grid .gm-tosafot{grid-column:2!important}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-rashi.gm-y-no-tosafot .gm-daf-grid{
 display:block!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus).gm-y-no-rashi.gm-y-no-tosafot .gm-daf-grid .gm-gemara{
 display:block!important;width:100%!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-gemara .gm-paragraphs{
 font-size:clamp(21px,calc(var(--gm-font) + 4px),31px)!important;
 line-height:1.34!important;font-weight:600!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-rashi .gm-paragraphs,
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-tosafot .gm-paragraphs{
 font-size:clamp(11px,calc(var(--gm-font) - 6px),18px)!important;
 line-height:1.22!important;font-weight:500!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-column h2{
 font-size:clamp(12px,calc(var(--gm-font) - 4px),17px)!important;
 line-height:1.15!important;margin:0 0 5px!important;padding:2px 0 3px!important;
}
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-gemara .gm-p,
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-rashi .gm-p,
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-grid .gm-tosafot .gm-p{
 margin:0 0 5px!important;padding:0 7px 0 0!important;
 overflow-wrap:break-word!important;word-break:normal!important;line-height:inherit!important;
 white-space:normal!important;text-align:justify!important;
}
/* v15.14.73 — continuation is on the SAME sheet after the Gemara.
   Keep regions hidden only when there is NO excess commentary. */
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-daf-continued[hidden],
.gm-yerushalmi .gm-sheet:not(.gm-focus) .gm-single-continued[hidden]{display:none!important}
.gm-yerushalmi .gm-y-below-primary{display:none!important}
.gm-yerushalmi .gm-y-below:not([hidden]){display:block}
@media(max-width:689px){
 .gm-yerushalmi .gm-sheet:not(.gm-focus){width:760px!important;min-width:760px!important;max-width:760px!important}
}

@media(max-width:689px) and (orientation:portrait){
 .gm-yerushalmi .gm-fit-stage.gm-fit-on > .gm-sheet:not(.gm-focus){
  width:760px!important;min-width:760px!important;max-width:760px!important;
 }
}
/* Most specific old Pnei-Moshe split rule used to override the general
   widths; beat it explicitly so real mobile screenshot gets a wide Gemara. */
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double:not(.gm-focus) .gm-daf-grid,
.gm-yerushalmi .gm-sheet.gm-flow-wide.gm-y-pnei-double.gm-y-no-tosafot:not(.gm-focus) .gm-daf-grid{
 grid-template-columns:17% minmax(0,1fr) 17%!important;
 gap:1%!important;
}

/* 15.14.73 — continuous Yerushalmi folio with NO empty center canyon.
   Commentary overflows are moved, never cloned, from narrow side rails to
   two broad tracks below the last line of Gemara, still INSIDE the paper. */
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-continued:not([hidden]){
 display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
 gap:2%!important;clear:both;direction:rtl;align-items:start!important;
 margin-top:6px!important;padding:8px 3px 0!important;
 border-top:1px solid #a59170;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-continued.gm-only-rashi:not([hidden]),
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-continued.gm-only-tosafot:not([hidden]){
 grid-template-columns:minmax(0,1fr)!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-continued .gm-paragraphs,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-single-continued .gm-paragraphs{
 font-family:'Noto Serif Hebrew','David',serif!important;
 font-size:clamp(12px,calc(var(--gm-font) - 5px),17px)!important;
 font-weight:500!important;line-height:1.32!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-continued .gm-p,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-single-continued .gm-p{
 margin:0 0 5px!important;padding:0 8px 0 0!important;
 text-align:justify!important;white-space:normal!important;overflow-wrap:break-word!important;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-single-continued:not([hidden]){
 display:block!important;clear:both;width:100%!important;margin-top:5px!important;
 padding:8px 3px 0!important;border-top:1px solid #b5a080;
}
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-daf-continued h2,
.gm-yerushalmi .gm-sheet.gm-flow-wide:not(.gm-focus) .gm-single-continued h2{
 font-size:13px!important;line-height:1.2!important;margin:0 0 5px!important;padding:0 0 4px!important;
 color:#4a3621!important;
}

/* KR 15.14.79: Jerusalem pages sourced from verified Vilna page references. */
.gm-yerushalmi .gm-field[hidden]{display:none!important}
.gm-yerushalmi .gm-gemara .gm-p{line-height:1.50;overflow-wrap:break-word;word-break:normal;text-align:justify}
.gm-yerushalmi .gm-column.gm-rashi .gm-p,.gm-yerushalmi .gm-column.gm-tosafot .gm-p{font-size:.80em;line-height:1.42}
.gm-yerushalmi .gm-notice{font-size:.9rem}

/* 15.14.80: explicit original 15.14.73 reading mode. */
.gm-y-mode-toggle{border:1px solid #bd9b45;border-radius:14px;background:rgba(207,168,63,.12);color:inherit;font:inherit;font-size:14px;font-weight:800;padding:10px 14px;cursor:pointer}
.gm-y-mode-toggle[hidden]{display:none!important}

/* 15.14.81: page length follows actual passage and commentary, not 430px placeholder */
.gm-yerushalmi .gm-sheet{min-height:0!important}
.gm-yerushalmi .gm-sheet .gm-daf-grid{min-height:0!important}

/* 15.14.83 — optional fast chapter jump is shown only when a verified index exists. */
#gmChapterField[hidden],.gm-controls .gm-field[hidden]{display:none!important}
.gm-controls .gm-chapter select{min-width:120px;max-width:210px}
.gm-yerushalmi .gm-daf select{min-width:95px}
.gm-yerushalmi .gm-side select{min-width:72px}

/* v15.14.87: source-only Fulda notice. Never mimics a licensed printed gloss. */
.gm-yerushalmi .gm-y-raf-link{
 display:inline-block;margin-top:8px;padding:7px 12px;border-radius:8px;
 border:1px solid var(--gm-comment-line);color:var(--gm-comment-card-ink);
 text-decoration:underline;font-weight:700;font-size:14px;
}
.gm-yerushalmi .gm-y-source-scan p{line-height:1.55;font-size:13px;}

/* 15.14.88 — usable outer-page commentators, as in the Bavli.
   The extra licensed sources live inside the two existing page margins;
   never force the entire printed folio to grow to the longest source. */
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-body{
  display:grid!important;grid-template-columns:95px minmax(0,1fr) 95px!important;
  gap:4px!important;align-items:stretch!important;width:100%!important;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-content{
  display:block!important;grid-column:2!important;width:100%!important;min-width:0!important;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-margin{
  display:block!important;min-width:0!important;min-height:0!important;
  position:relative!important;grid-row:1!important;height:100%!important;padding:0 3px!important;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-margin-right{grid-column:1!important}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-margin-left{grid-column:3!important}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-rail-heading,
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-rail-notes{display:none!important}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-margin-stack{
  height:var(--gm-y-rail-height,620px);max-height:var(--gm-y-rail-height,620px);
  overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;overscroll-behavior:contain;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-rail-item button{font-size:11px;line-height:1.4;min-width:0}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-rail-name{font-size:12px;line-height:1.35}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-rail-excerpt{line-height:1.4;max-height:8.4em}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-rail-scan{
 display:block;text-align:right;direction:rtl;padding:4px 0;color:#533615;
 font-size:11px;font-weight:700;overflow-wrap:anywhere;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras .gm-y-rail-item:focus-within{
  outline:2px solid #8e661f;outline-offset:-2px;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-daf-grid{
  grid-template-columns:19% minmax(0,1fr) 19%!important;gap:1%!important;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus).gm-y-no-tosafot .gm-daf-grid{
  grid-template-columns:25% minmax(0,1fr)!important;
}
.gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus).gm-y-no-rashi .gm-daf-grid{
  grid-template-columns:minmax(0,1fr) 25%!important;
}
@media(min-width:920px){
 .gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-folio-body{
  grid-template-columns:118px minmax(0,1fr) 118px!important;
 }
}
@media print{
 .gm-yerushalmi .gm-sheet.gm-y-has-extras:not(.gm-focus) .gm-y-margin-stack{
  position:static!important;height:auto!important;max-height:none!important;overflow:visible!important;
 }
}

/* 15.14.92: swipe hint; native selection and pan remain untouched */
.gm-swipe-hint{margin:6px 0 10px;text-align:center;font-size:13px;line-height:1.65;opacity:.87}
@media(min-width:1025px){.gm-swipe-hint{display:none}}


/* 15.14.94: main-site bottom tabs on /gemara/, both Bavli and Yerushalmi.
   Site links go to existing index.html tabs: no independent tab logic. */
.gm-site-nav,.gm-site-more{display:none}
.gm-site-more[hidden]{display:none!important}
@media(max-width:900px), (display-mode:standalone){
 body{padding-bottom:calc(83px + env(safe-area-inset-bottom,0px))}
 .gm-site-nav{
  position:fixed;inset-inline:0;bottom:0;z-index:360;
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));direction:rtl;
  padding:7px max(5px,env(safe-area-inset-right,0px)) calc(7px + env(safe-area-inset-bottom,0px)) max(5px,env(safe-area-inset-left,0px));
  border-top:1px solid rgba(221,181,65,.42);
  background:rgba(7,7,6,.97);box-shadow:0 -8px 29px #0009;
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
 }
 .gm-site-nav .gm-site-nav-item{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  min-width:0;min-height:54px;box-sizing:border-box;margin:0;padding:4px 2px;
  border:0;border-radius:8px;background:transparent;color:#dfd5bc;
  font:800 11px/1.2 Arial,"Noto Sans Hebrew",sans-serif;
  text-decoration:none;text-align:center;white-space:nowrap;
 }
 .gm-site-nav .gm-site-nav-icon{font-size:21px;line-height:1.1}
 .gm-site-nav .gm-site-nav-current{color:#f1ca59}
 .gm-site-nav .gm-site-nav-item:is(:focus-visible,:hover){outline:2px solid #e9bf60;outline-offset:-2px}
 .gm-site-more:not([hidden]){
  display:block;position:fixed;z-index:359;direction:rtl;
  inset-inline:8px;bottom:calc(75px + env(safe-area-inset-bottom,0px));
  max-width:540px;max-height:min(68dvh,540px);overflow:auto;
  margin-inline:auto;padding:13px;border:1px solid #b79a5f;border-radius:17px;
  background:#18130c;color:#f8eccb;box-shadow:0 12px 32px #000c;
 }
 .gm-site-more-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
 .gm-site-more-heading strong{color:#f1ca59;font-size:17px}
 .gm-site-more-heading button{min-height:33px;padding:3px 11px;color:inherit;background:transparent;border:1px solid #b79a5f}
 .gm-site-more-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .gm-site-more-links a{display:flex;align-items:center;min-height:46px;padding:8px 10px;
  border:1px solid rgba(221,181,65,.3);border-radius:12px;
  background:#2a2115;color:inherit;text-decoration:none;font-size:14px;font-weight:700}
 .gm-site-more-links a:focus-visible{outline:2px solid #f1ca59}
 :root.gm-light .gm-site-nav{background:#fff4db;color:#392714;border-top-color:#bea575}
 :root.gm-light .gm-site-nav .gm-site-nav-item{color:#4a351b}
 :root.gm-light .gm-site-nav .gm-site-nav-current{color:#855308}
 :root.gm-light .gm-site-more:not([hidden]){background:#fff4db;color:#382712}
 :root.gm-light .gm-site-more-heading strong{color:#79531b}
 :root.gm-light .gm-site-more-links a{background:#f1e2c3;border-color:#ad976d}
}
/* Fullscreen reading is deliberately immersive. Exit fullscreen to navigate. */
body.gm-fs-body-locked .gm-site-nav,body.gm-fs-body-locked .gm-site-more{display:none!important}
@media print{.gm-site-nav,.gm-site-more{display:none!important}}

/* 15.16.7 — shared always-on-by-default study screen Wake Lock. */
#gmWake{min-height:39px;min-width:112px;white-space:normal;border:1px solid #be9f62;border-radius:10px;background:#f6e4b9;color:#382612;font-weight:800}
#gmWake[aria-pressed="false"],#gmFullscreenWake[aria-pressed="false"]{opacity:.75}
#gmFullscreenWake{min-height:36px;font-weight:700}
@media(max-width:650px){#gmWake{min-width:105px}}
