:root{color-scheme:dark;--ink:#182423;--deep:#101a19;--paper:#fff5d8;--gold:#d3b780;--jade:#9abaac;--red:#813b31;--line:#61716b;--font:"Microsoft JhengHei","PingFang TC","Noto Sans TC",sans-serif;font-family:var(--font);font-size:100%;color:#edf1ea;background:var(--deep)}
*{box-sizing:border-box}body{margin:0;min-width:280px;background:radial-gradient(ellipse at 50% 0%,#2d3c37 0%,#101a19 65%);min-height:100vh}button,a,input{font:inherit}button{color:inherit;cursor:pointer;min-height:44px;border:1px solid #667269;border-radius:4px;background:#25342f;padding:.65rem 1.1rem;transition:background .15s,border-color .15s}button:hover{background:#34473e;border-color:var(--gold)}button:disabled{opacity:.45;cursor:default}button:focus-visible,a:focus-visible{outline:3px solid #c2ebd5;outline-offset:4px}[hidden]{display:none!important}.page{max-width:1168px;margin:auto;padding:20px 32px 40px}.masthead{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:25px}.brand{display:flex;align-items:center;gap:12px;flex-shrink:0}.brand h1{font-family:"Noto Serif TC","Songti TC","PMingLiU",serif;font-size:1.35rem;font-weight:600;letter-spacing:.09em;margin:0}.seal{display:grid;place-items:center;border:1px solid #b78070;border-radius:3px;color:#ebbbab;background:#65362e;width:33px;height:37px;font-family:serif;font-size:1.3rem}.tools{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.tools button{font-size:.9rem;background:transparent;border-color:transparent;padding:.45rem .75rem;color:#cfdbd0}.tools button:hover{background:#30413a;border-color:#637c6d}.chapter-line{display:flex;justify-content:center;gap:3.2rem;color:#899b8e;margin:0 0 15px}.chapter{display:flex;gap:10px;align-items:center;font-family:serif;font-size:1rem}.chapter>span{font-family:var(--font);font-size:.875rem;letter-spacing:.05em}.chapter.current{color:var(--gold)}.game-frame{border:1px solid #766a50;border-radius:5px;box-shadow:0 24px 60px #0005;overflow:hidden;background:#0a100d}.stage{position:relative;aspect-ratio:16/9;overflow:hidden;background:#101612;isolation:isolate;cursor:pointer}#pictures{position:absolute;inset:0;overflow:hidden}#pictures img{position:absolute;max-width:none;object-fit:fill;pointer-events:none;transition:opacity .24s ease,transform .28s ease,left .28s ease,top .28s ease;will-change:opacity}.title-screen{position:absolute;inset:0;z-index:50;cursor:default}.cover{position:absolute;width:100%;height:100%;object-fit:cover}.start-menu{position:absolute;left:6.1%;top:59%;display:flex;flex-direction:column;gap:10px;width:25%;min-width:178px}.start-menu button{background:#f8f4e9ed;color:#36443a;border-color:#716543;font-family:"Noto Serif TC","Songti TC",serif;font-size:1.12rem;letter-spacing:.08em;box-shadow:0 3px 10px #0001}.start-menu button:hover{background:#fff9e9;border-color:#9e4937}.start-menu .primary,button.primary{background:var(--red);color:#fff5de;border-color:#aa7260}.primary:hover,.start-menu .primary:hover{background:#9a493a;color:#fff9e9}.dialogue-panel{container-type:inline-size;background:var(--ink)}.dialogue{--dialogue-height:11rem;--dialogue-font:1.2rem;--dialogue-leading:1.65;--dialogue-ornament:100px;--dialogue-edge-width:calc(var(--dialogue-ornament) * 1.3);--dialogue-edge-height:calc(var(--dialogue-edge-width) * 153 / 118);position:relative;isolation:isolate;height:var(--dialogue-height);color:#282a22;background:#fff5d8 url('../assets/content/ecdefccaee2f84972b62.png') center/142% auto repeat-y;cursor:pointer;border-top:1px solid #99844f}.dialogue::before,.dialogue::after{content:"";position:absolute;top:0;bottom:0;width:var(--dialogue-edge-width);background:url('../assets/content/ecdefccaee2f84972b62.png') left top/auto var(--dialogue-edge-height) repeat-y;pointer-events:none;z-index:-1}.dialogue::before{left:0}.dialogue::after{right:0;background-position:right top}.dialogue-inner{height:100%;display:grid;grid-template-rows:1.5rem minmax(0,1fr);gap:.5rem;padding:1rem calc(var(--dialogue-edge-width) + .75rem)}.speaker{font-weight:700;font-size:1.0625rem;letter-spacing:.06em;margin:0;line-height:1.4;color:#6d3529}.story-text{min-height:0;font-size:var(--dialogue-font);line-height:var(--dialogue-leading);white-space:pre-wrap;overflow-wrap:anywhere;letter-spacing:.02em;overflow:auto;scrollbar-width:thin}.story-text .color-emphasis{font-weight:650}.choices{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:0;border:0}.choice-button{position:relative;display:flex;gap:16px;align-items:center;text-align:left;min-height:52px;font-size:1.08rem;line-height:1.5;color:#3e3324;background:#fffbee;border-color:#a6996d;padding:.65rem 1rem;box-shadow:0 2px 5px #4c3c1810}.choice-button:hover{color:#652d24;background:#faf0cd;border-color:#813b31}.choice-number{border:1px solid #a89363;border-radius:3px;font-family:serif;font-size:1rem;display:grid;place-items:center;min-width:24px;height:27px;color:#725b36}.dialogue-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:0 max(16px,8%);min-height:48px}.dialogue-actions button{color:#c6d3c4;background:none;border:none;font-size:.875rem;padding:7px 2px;min-height:44px}.dialogue-actions .next-button{font-size:1rem;color:var(--gold);padding-right:4px}.next-mark{margin-left:13px;color:var(--gold)}.below-stage{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:58px;margin-top:7px}.below-stage p{font-size:.875rem;line-height:1.65;color:#a6b5a7;margin:0}.quiet{border:none!important;background:transparent!important;color:#b7c6b7;font-size:.875rem;padding:.45rem .35rem}.quiet:hover{text-decoration:underline}.ending{color:#efe8d4;text-align:center;padding:34px 11% 40px;background:linear-gradient(160deg,#283c31,#182622)}.ending-eyebrow{color:#bdc9b5;font-size:.875rem;letter-spacing:.1em;margin:0 0 10px}.ending h2{font-family:"Noto Serif TC","Songti TC",serif;font-size:1.8rem;font-weight:500;letter-spacing:.08em;margin:0 0 22px;color:var(--gold)}.ending-text{font-size:1.15rem;line-height:1.9;white-space:pre-wrap;margin:0 0 25px}.ending-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.notice{padding:20px;color:#fff5d8;border:1px solid #877154;line-height:1.8}dialog{color:#efeede;background:#1f3028;border:1px solid #9d8961;border-radius:7px;padding:0;width:min(600px,calc(100% - 28px));max-height:calc(100dvh - 40px);box-shadow:0 24px 80px #0009}dialog::backdrop{background:#07100acc;backdrop-filter:blur(4px)}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 22px;border-bottom:1px solid #5a695b;gap:12px;position:sticky;top:0;background:#1f3028;z-index:1}.modal-header h2{font-size:1.3rem;font-weight:600;letter-spacing:.08em;margin:0}.modal-header button{min-width:44px;padding:5px;border:none;background:none}.modal-note{color:#b3c2b3;font-size:.875rem;line-height:1.65;margin:0 0 18px}#dialog-body{padding:20px 22px}.save-slot{border:1px solid #687862;border-radius:4px;padding:15px;margin-bottom:12px;display:flex;justify-content:space-between;gap:20px;align-items:center;background:#273a2d}.slot-copy{min-width:0}.slot-copy strong{font-size:1rem;color:var(--gold);display:block;margin-bottom:6px}.slot-copy p{font-size:.9rem;line-height:1.5;overflow-wrap:anywhere;color:#d4ddc9;margin:0}.slot-copy time{font-size:.875rem;color:#9fb19c;display:block;margin-top:6px}.save-slot button{white-space:nowrap}.history-item{border-bottom:1px solid #53664f;padding:12px 0}.history-item:last-child{border:0}.history-item strong{font-size:.875rem;display:block;color:var(--gold);margin-bottom:6px}.history-item p{margin:0;font-size:1rem;line-height:1.8;white-space:pre-wrap}.history-item.choice strong{color:#b9dcc4}.confirm-copy{font-size:1rem;line-height:1.85;margin:0 0 24px}.confirm-actions{display:flex;justify-content:flex-end;gap:12px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);border:1px solid #b4a278;background:#263c2e;color:#f1efd7;border-radius:5px;padding:12px 20px;box-shadow:0 8px 28px #0006;font-size:1rem;line-height:1.6;z-index:100}.skip-link{position:absolute;left:16px;top:-70px;color:#1c2b22;background:#fff4ce;padding:12px;z-index:150}.skip-link:focus{top:12px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.game-frame:fullscreen{width:100%;height:100%;border:0;overflow:auto;display:flex;flex-direction:column;justify-content:center;background:#101a19}.game-frame:fullscreen .stage{width:min(100%,calc((100dvh - 200px)*16/9));flex-shrink:0;align-self:center}.game-frame:fullscreen .dialogue-panel{width:min(100%,1102px);align-self:center}
@media(max-width:900px){.masthead{align-items:flex-start;gap:10px;flex-direction:column;margin-bottom:18px}.tools{justify-content:flex-start;margin-left:-10px}.page{padding:18px 22px 28px}.brand h1{font-size:1.22rem}.chapter-line{gap:2rem}}
@media(max-width:600px){.page{padding:16px 12px 22px}.masthead{margin-bottom:14px;gap:9px}.brand{gap:9px}.brand h1{font-size:1.1rem;letter-spacing:.06em}.seal{width:29px;height:32px;font-size:1.15rem}.tools{gap:0;justify-content:space-between;width:calc(100% + 8px);margin-left:-4px}.tools button{font-size:.875rem;padding:.35rem .5rem}.chapter-line{gap:0;justify-content:space-between;padding:0 5px;margin-bottom:12px}.chapter{gap:6px;font-size:.875rem}.chapter>span{font-size:.875rem;letter-spacing:0}.start-menu{top:auto;bottom:8%;left:5%;min-width:0;width:41%;gap:8px}.start-menu button{font-size:1rem;min-height:41px;padding:.5rem .3rem;letter-spacing:.04em}.choice-button{font-size:1rem;gap:12px;padding:.65rem .8rem}.below-stage{gap:8px;align-items:flex-start;flex-direction:column;margin-top:12px}.below-stage p{font-size:.875rem;line-height:1.75}.below-stage>button{align-self:flex-end}.ending{padding:27px 8% 32px}.ending h2{font-size:1.5rem}.ending-text{font-size:1.05rem}.modal-header{padding:14px 16px}#dialog-body{padding:17px 16px}.save-slot{padding:13px;gap:12px}.save-slot button{padding:.5rem .65rem;font-size:.9rem}.game-frame:fullscreen .stage,.game-frame:fullscreen .dialogue-panel{width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}

/* Fixed dialogue sizes reserve room for all 530 original pages, including explicit line breaks.
   The edge crops use 118:153, enlarged 1.3 times and tiled over the full height. */
@container(max-width:900px){.dialogue{--dialogue-height:14rem;--dialogue-font:1.15rem;--dialogue-ornament:74px}}
@container(max-width:600px){.dialogue{--dialogue-height:13.5rem;--dialogue-font:1.0625rem;--dialogue-leading:1.7;--dialogue-ornament:48px}.dialogue-inner{padding:.875rem calc(var(--dialogue-edge-width) + .75rem)}}
@container(max-width:480px){.dialogue{--dialogue-height:15rem;--dialogue-ornament:36px}}
@container(max-width:360px){.dialogue{--dialogue-height:17rem;--dialogue-font:1rem;--dialogue-ornament:28px}.dialogue-inner{padding:.875rem calc(var(--dialogue-edge-width) + .625rem)}}
@container(max-width:280px){.dialogue{--dialogue-height:19rem}}

/* Keep repeated clicks and long presses from selecting text or showing a touch highlight. */
.game-frame{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
button{-webkit-tap-highlight-color:transparent}
.dialogue{touch-action:pan-y pinch-zoom}
.hold-status{font-size:.875rem;color:var(--gold);white-space:nowrap}

/* Interludes use alignment rather than device-dependent space padding. */
.dialogue.interlude .dialogue-inner{display:flex;flex-direction:column;justify-content:center}
.dialogue.interlude .story-text{flex-shrink:0;text-align:center}
.history-item.interlude p{text-align:center}
.ending-feedback{max-width:38rem;margin:0 auto 25px;padding:14px 18px;border:1px solid var(--line);border-radius:4px;background:#101a1940;text-align:left;font-size:1rem;line-height:1.8;color:#dce4d5;white-space:pre-wrap}

/* Completion unlocks two separate replay actions without adding rows to the scene. */
.title-screen.replay-unlocked .start-menu,.replay-menu{top:auto;bottom:8%;width:41%;min-width:0;gap:8px}
.replay-menu{position:absolute;right:5%;display:flex;flex-direction:column}
.replay-menu button{background:var(--deep);color:var(--paper);border-color:var(--gold);font-family:"Noto Serif TC","Songti TC",serif;letter-spacing:.04em}
.replay-menu button:hover{background:var(--ink)}
.title-screen.replay-unlocked button{min-height:44px}
.chapter-slot h3{font-size:1rem;color:var(--gold);margin:0 0 .5rem;line-height:1.5}
.library-progress{color:var(--gold);font-size:1.1rem;margin:0 0 .75rem}
.route-chapter+.route-chapter{margin-top:1.5rem}
.route-chapter-heading{display:flex;justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:.75rem}
.route-chapter-heading h3{font-size:1rem;color:var(--gold);line-height:1.5;margin:0}
.route-chapter-heading button{flex-shrink:0;font-size:.875rem;padding:.5rem .75rem}
.route-card{border:1px solid var(--line);border-radius:4px;margin-bottom:.5rem;background:var(--ink);overflow-wrap:anywhere}
.route-card>summary{cursor:pointer;padding:.75rem;line-height:1.6}
.route-card summary:focus-visible{outline:3px solid var(--jade);outline-offset:-3px}
.route-title{font-size:.9375rem;line-height:1.6}
.route-state{display:block;color:var(--jade);font-size:.8125rem;line-height:1.5;margin:.25rem 0 0}
.route-content{border-top:1px solid var(--line);padding:1rem}
.route-category{color:var(--gold);font-size:.875rem;margin:0 0 .75rem}
.route-conclusion{white-space:pre-wrap;line-height:1.8;margin:0 0 .75rem}
.route-feedback{border-left:2px solid var(--gold);padding-left:.75rem;font-size:.9375rem;line-height:1.8;margin:0 0 1rem}
.route-trail{font-size:.875rem;line-height:1.7;margin:0 0 1rem}
.route-trail summary{cursor:pointer;color:var(--jade);padding:.25rem 0}
.route-trail ol{padding-left:1.5rem;margin:.5rem 0 0}
.route-trail li+li{margin-top:.5rem}
.route-content button{width:100%}
.route-card.unexplored{padding:.75rem}
.unexplored p{margin:0}
@media(max-width:600px){
  .replay-menu button{font-size:1rem;padding:.5rem .3rem}
  .chapter-slot{align-items:flex-start;flex-direction:column;gap:.75rem}
  .chapter-slot button{width:100%}
  .route-chapter-heading{flex-wrap:wrap}
  .route-content{padding:.75rem}
}

/* Choices stay inside the scene and do not push the dialogue or page down. */
.scene-choices{position:absolute;inset:0;z-index:60;display:grid;place-items:center;padding:16px;background:#07110bb8;backdrop-filter:blur(3px);cursor:default}
.choice-dialog{width:min(100%,540px);max-height:100%;overflow:auto;padding:18px;border:1px solid #b29a67;border-radius:7px;background:#1f3028f5;box-shadow:0 12px 36px #0007}
.choice-dialog h2{margin:0 0 14px;text-align:center;font-family:"Noto Serif TC","Songti TC",serif;font-size:1.2rem;line-height:1.3;font-weight:600;letter-spacing:.06em;color:var(--gold)}
.stage{touch-action:pan-y pinch-zoom;container-type:inline-size}
@container(max-width:600px){.scene-choices{padding:10px}.choice-dialog{padding:12px}.choice-dialog h2{font-size:1rem;margin-bottom:10px}.choices{gap:8px}.choice-dialog .choice-button{min-height:44px;padding:.45rem .7rem}}
@container(max-width:400px){.scene-choices{padding:6px}.choice-dialog{padding:8px}.choice-dialog h2{font-size:.9375rem;line-height:1.2;margin-bottom:8px}.choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.choice-dialog .choice-button{justify-content:center;text-align:center;font-size:.875rem;line-height:1.3;padding:.35rem .4rem}.choice-dialog .choice-number{display:none}.choice-button:nth-child(3){grid-column:1/-1}}

.not-found{padding-top:clamp(4rem,15vh,10rem);max-width:44rem}.not-found h1{color:var(--gold)}.not-found p{line-height:1.8}.not-found a{display:inline-block;color:#c2ebd5;padding:.75rem 0}
/* Reserve 392 px for the fixed dialogue, controls and page chrome; the scene stays 16:9.
   Fullscreen only reserves the dialogue, controls and a small margin (242 px). */
@media(min-width:901px){
  .page{padding-top:12px;padding-bottom:16px}
  .masthead{margin-bottom:12px}
  .chapter-line{margin-bottom:10px}
  .game-frame{width:min(100%,max(384px,calc((100dvh - 392px) * 16 / 9)));margin-inline:auto}
  .game-frame .dialogue{--dialogue-height:11rem;--dialogue-font:1.0625rem;--dialogue-leading:1.55;--dialogue-ornament:48px}
  .below-stage{min-height:32px;margin-top:6px}
  .below-stage p{font-size:.8125rem;line-height:1.5}
  .below-stage>button{min-height:32px}
  .game-frame:fullscreen{width:100%;height:100%;margin:0}
  .game-frame:fullscreen .stage,.game-frame:fullscreen .dialogue-panel{width:min(100%,1102px,max(384px,calc((100dvh - 242px) * 16 / 9)))}
  @container(max-width:600px){.game-frame .dialogue{--dialogue-font:1rem;--dialogue-leading:1.5;--dialogue-ornament:32px}.game-frame .dialogue-inner{padding:.625rem calc(var(--dialogue-edge-width) + .75rem)}}
}
/* Interactive original-text guide */
#menu-dialog.guide-mode[open]{width:min(980px,calc(100% - 24px));height:min(92dvh,1000px);max-height:calc(100dvh - 24px);display:flex;flex-direction:column;overflow:hidden}
#menu-dialog.guide-mode .modal-header{flex:0 0 auto}
#menu-dialog.guide-mode #dialog-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:0;padding:0;overflow:hidden}
.guide-intro{flex:0 0 auto;margin:0;padding:10px 22px;color:#c4d0c2;font-size:.95rem;line-height:1.55}
.guide-controls{flex:0 0 auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 22px;background:#26372f;border-top:1px solid #526357;border-bottom:1px solid #526357}
.guide-controls button{min-height:42px;padding:.5rem .85rem;font-size:.95rem;color:#f0ead8;border-color:#71806b;background:#314439;white-space:nowrap}
.guide-controls button:hover{background:#3c5143}
.guide-controls button:disabled{opacity:.45}
.guide-select-label{font-size:.9rem;color:#d1d9ce}
#guide-section-select{min-height:42px;max-width:360px;min-width:190px;padding:.45rem .65rem;color:#26352d;background:#f7f0de;border:1px solid #a99870;border-radius:4px;font:inherit}
.guide-return{margin-left:auto!important;color:#ffeed0!important;border-color:#9f7950!important}
.guide-position{flex:0 0 auto;margin:0;padding:8px 22px;color:#ecd7a4;font-size:.9rem;line-height:1.45}
.guide-gloss-panel{flex:0 0 auto;display:grid;grid-template-columns:minmax(90px,.2fr) minmax(0,1fr) auto;align-items:start;gap:8px 14px;margin:0 22px 12px;padding:10px 14px;background:#f5ecd4;border:1px solid #b7a579;border-left:4px solid #a76e43;border-radius:4px;color:#2c3029;min-height:56px}
.guide-gloss-panel strong{font-family:"Noto Serif TC","Songti TC",serif;font-size:1rem;color:#633d2d}
.guide-gloss-definition{margin:0;font-size:1rem;line-height:1.65;overflow-wrap:anywhere}
.guide-gloss-source{margin:2px 0 0;font-size:.8rem;line-height:1.4;color:#74684f;white-space:nowrap}
.guide-article{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;margin:0 22px 18px;padding:0 18px 18px;background:#fbf5e7;border:1px solid #a6946d;border-radius:4px;color:#302c24;scroll-behavior:smooth}
.guide-passage{scroll-margin-top:10px;padding:18px 18px 20px;border-left:4px solid transparent;border-bottom:1px solid #ded2b5}
.guide-passage:last-of-type{border-bottom:0}
.guide-passage[aria-current="location"]{background:#f1e5c8;border-left-color:#a86b40}
.guide-passage h3{margin:0 0 10px;color:#724438;font-family:"Noto Serif TC","Songti TC",serif;font-size:1.08rem;font-weight:650;letter-spacing:.035em}
.guide-text{margin:0;font-size:1.125rem;line-height:2;letter-spacing:.025em;overflow-wrap:anywhere}
.guide-term{display:inline;min-height:0;border:0;border-bottom:1px dotted #8a6338;border-radius:0;padding:0 1px;background:transparent;color:#70442f;font:inherit;font-weight:650;line-height:inherit;vertical-align:baseline;white-space:normal}
.guide-term:hover{background:#ead8ab;color:#542d24;border-color:#72402d}
.guide-term:focus-visible{outline:2px solid #714431;outline-offset:2px;border-radius:2px}
.guide-references{margin:14px 18px 0;padding:12px 0 4px;border-top:1px solid #ded2b5;color:#6b624f;font-size:.88rem;line-height:1.7}
.guide-references a{color:#704533;text-underline-offset:3px}
#menu-dialog.guide-mode #dialog-close{flex:0 0 44px}
@media(max-width:600px){
  #menu-dialog.guide-mode[open]{width:calc(100% - 16px);height:min(94dvh,1000px);max-height:calc(100dvh - 16px)}
  #menu-dialog.guide-mode .modal-header{padding:12px 14px}
  .guide-intro{padding:8px 14px;font-size:.9rem}
  .guide-controls{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"previous next" "label select" "return return";gap:7px;padding:9px 14px}
  #guide-previous{grid-area:previous}
  #guide-next{grid-area:next}
  .guide-select-label{grid-area:label;align-self:center}
  #guide-section-select{grid-area:select;width:100%;min-width:0;max-width:none}
  .guide-return{grid-area:return;margin:0!important;width:100%}
  .guide-controls button{width:100%;padding:.45rem .55rem}
  .guide-position{padding:7px 14px;font-size:.86rem}
  .guide-gloss-panel{grid-template-columns:minmax(66px,.28fr) minmax(0,1fr);gap:4px 9px;margin:0 12px 10px;padding:8px 10px}
  .guide-gloss-panel strong{font-size:.92rem}
  .guide-gloss-definition{font-size:.95rem;line-height:1.55}
  .guide-gloss-source{grid-column:2;font-size:.77rem;white-space:normal}
  .guide-article{margin:0 12px 12px;padding:0 8px 12px}
  .guide-passage{padding:14px 11px 16px}
  .guide-passage h3{font-size:1rem}
  .guide-text{font-size:1.03rem;line-height:1.9;letter-spacing:.01em}
  .guide-references{margin:12px 11px 0;font-size:.84rem}
}
@media(prefers-reduced-motion:reduce){.guide-article{scroll-behavior:auto}}

/* The expanded notes stay bounded so the original passage remains visible. */
.guide-gloss-panel{grid-template-columns:minmax(0,1fr) auto;max-height:min(30dvh,15rem);overflow:auto;overscroll-behavior:contain;min-height:76px}
#guide-gloss-title{grid-column:1;overflow-wrap:anywhere}
.guide-gloss-definition{grid-column:1/-1;grid-row:2}
.guide-gloss-source{grid-column:2;grid-row:1}
.guide-gloss-context{grid-column:1/-1;margin:0;color:#76674e;font-size:.82rem;line-height:1.5;overflow-wrap:anywhere}
#guide-gloss-related{grid-column:1/-1;font-size:.9rem;line-height:1.6}
#guide-gloss-related summary{cursor:pointer;color:#69402c;padding:4px 0}
.guide-note-row{border-top:1px solid #d8c9a5;margin-top:8px;padding-top:8px}
.guide-note-row p{margin:3px 0}
.guide-note-source{color:#796b52;font-size:.8rem}
.guide-sentence-index{margin-top:16px;padding-top:10px;border-top:1px dashed #c5b591;font-size:.95rem;line-height:1.6}
.guide-sentence-index>summary{color:#70442f;cursor:pointer;font-weight:650;padding:3px 0}
.guide-sentence-list{display:grid;gap:8px;margin-top:10px}
.guide-sentence-button{color:#5d402e;background:#f2e7cd;border-color:#c5b591;padding:.55rem .75rem;text-align:left;min-height:44px;font-size:.94rem;line-height:1.6;white-space:normal}
.guide-sentence-button:hover{background:#e8d8b3;border-color:#9c7b4d}
.guide-sentence-button:focus-visible{outline:2px solid #714431;outline-offset:2px}
@media(max-width:600px){
  .guide-gloss-panel{grid-template-columns:minmax(0,1fr) auto;gap:4px 9px;max-height:28dvh;min-height:64px}
  .guide-gloss-source{grid-column:2;font-size:.75rem}
  .guide-gloss-definition{font-size:.92rem;line-height:1.5}
  #guide-gloss-title{font-size:.9rem}
  .guide-sentence-button{font-size:.88rem}
}
