/* Responsive refinements: preserve artwork and chapter order. */
:root{--reading-gutter:clamp(20px,3vw,44px)}
body .page-title-main,body [data-role='chapter-title'],body .sutra-title{overflow-wrap:break-word}
body .cat-filters{flex-wrap:wrap;gap:10px}
body[data-site-screen='chapter-03'] .screen-content,
body[data-site-screen='chapter-5-audition'] .screen-content{padding:0 32px 48px 88px;box-sizing:border-box;scroll-padding:24px}
body[data-site-screen='chapter-03'] .buddha-scroll-area{width:100%;max-width:100%}
body[data-site-screen='chapter-03'] .buddha-cards-row{padding:0 8px;justify-content:flex-start}
body[data-site-screen='chapter-03'] .buddha-card-name-zh{height:auto;min-height:28px;white-space:normal;overflow-wrap:break-word}
body[data-site-screen='chapter-5-audition'] .track-cards-row{width:100%;flex-wrap:wrap;justify-content:center}
body[data-site-screen='chapter-5-audition'] .self-sounding-card{max-width:100%;box-sizing:border-box}
body .detail-panel,body .food-panel,body .label-modal{max-width:calc(100vw - 32px);max-height:calc(100dvh - 100px);overflow-y:auto;overscroll-behavior:contain}
body[data-site-screen='chapter-05'] #screen2{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:min-content;align-content:start;gap:16px;padding:60px 40px 48px 96px;overflow-y:auto;box-sizing:border-box;scroll-padding:24px}
body[data-site-screen='chapter-05'] #screen2Intro{position:relative;top:auto;left:auto;transform:none!important;grid-area:1 / 1 / 2 / -1;max-width:none;width:auto;padding:0 20px 12px}
body[data-site-screen='chapter-05'] #screen2 .intro-main{font-size:clamp(18px,2vw,24px);letter-spacing:.01em;line-height:1.55}
body[data-site-screen='chapter-05'] #screen2 .intro-sub{font-size:15px;line-height:1.65;letter-spacing:.01em}
body[data-site-screen='chapter-05'] #screen2 .ensemble-stage,
body[data-site-screen='chapter-05'] #screen2 .inst-dots-layer{position:relative;top:auto;left:auto;width:100%;grid-area:2 / 1 / 3 / -1;transform:none!important;align-self:start}
body[data-site-screen='chapter-05'] #screen2 .label{position:relative;top:auto;left:auto;right:auto;bottom:auto;transform:none!important;width:auto;max-width:none!important;min-width:0;white-space:normal;padding:16px;box-sizing:border-box}
body[data-site-screen='chapter-05'] #label1{grid-area:3 / 1}
body[data-site-screen='chapter-05'] #label2{grid-area:3 / 2}
body[data-site-screen='chapter-05'] #label3{grid-area:3 / 3}
body[data-site-screen='chapter-05'] #label4{grid-area:4 / 1}
body[data-site-screen='chapter-05'] #label5{grid-area:4 / 2}
body[data-site-screen='chapter-05'] #screen2 .label-number{font-size:clamp(26px,3vw,42px);line-height:1.2;overflow-wrap:anywhere}
body[data-site-screen='chapter-05'] #screen2 .label-tag{white-space:normal;overflow:visible;line-height:1.5}
body[data-site-screen='chapter-05'] #screen2 .leader-line{display:none}
body[data-site-screen='chapter-05'] #instToggleBtn{position:relative;top:auto;left:auto;right:auto;bottom:auto;transform:none;grid-area:5 / 1;justify-self:center;align-self:center;max-width:100%}
body[data-site-screen='chapter-05'] #audioBtnMain{position:relative;top:auto;left:auto;right:auto;bottom:auto;transform:none;grid-area:5 / 2;justify-self:center;width:76px;height:76px}
body[data-site-screen='chapter-05'] #audioPreviewLabel{position:relative;top:auto;left:auto;right:auto;bottom:auto;transform:none;grid-area:5 / 3;align-self:center;white-space:normal;text-align:center}
body[data-site-screen='chapter-05'] #audioTooltip{display:none}
body[data-site-screen='chapter-05'] #screen2Caption{position:relative;top:auto;left:auto;right:auto;bottom:auto;grid-area:6 / 1 / 7 / -1;max-width:none;width:auto;margin-top:8px;line-height:1.65}
/* Book pages keep their hand-drawn composition; text remains scrollable. */
body[data-site-screen='chapter-01'] .card-copy{overscroll-behavior:contain;scrollbar-width:thin;padding-bottom:32px}
@media(max-width:768px){
 body .page-title-main{font-size:clamp(25px,6vw,34px)}
 body .cat-filters{margin-bottom:24px}
 body[data-site-screen='chapter-03'] .screen-content,
 body[data-site-screen='chapter-5-audition'] .screen-content{padding:12px 18px 36px 68px}
 body[data-site-screen='chapter-03'] .page-header,
 body[data-site-screen='chapter-5-audition'] .page-header{margin-top:28px;max-width:100%}
 body[data-site-screen='chapter-03'] .buddha-card{width:min(280px,calc(100vw - 104px))}
 body[data-site-screen='chapter-03'] .buddha-cards-row{gap:16px}
 body[data-site-screen='chapter-5-audition'] .track-card{width:100%;max-width:320px}
 body[data-site-screen='chapter-5-audition'] .track-card-video{width:100%}
 body[data-site-screen='chapter-05'] #screen2{grid-template-columns:repeat(2,minmax(0,1fr));padding:64px 18px 36px 68px;gap:12px}
 body[data-site-screen='chapter-05'] #label3{grid-area:4 / 1}
 body[data-site-screen='chapter-05'] #label4{grid-area:4 / 2}
 body[data-site-screen='chapter-05'] #label5{grid-area:5 / 1 / 6 / -1}
 body[data-site-screen='chapter-05'] #instToggleBtn{grid-area:6 / 1}
 body[data-site-screen='chapter-05'] #audioBtnMain{grid-area:6 / 2}
 body[data-site-screen='chapter-05'] #audioPreviewLabel{grid-area:7 / 1 / 8 / -1}
 body[data-site-screen='chapter-05'] #screen2Caption{grid-area:8 / 1 / 9 / -1}
 body[data-site-screen='chapter-05'] #screen2 .label{padding:12px}
 body[data-site-screen='chapter-05'] #screen2 .label-number{font-size:28px}
 body[data-site-screen='chapter-05'] #screen2 .label-num-sm{font-size:26px!important}
 body[data-site-screen='chapter-05'] #screen2Intro{padding:0 0 10px}
 body[data-site-screen='chapter-05'] #screen2 .intro-main{font-size:19px}
 body[data-site-screen='chapter-05'] #screen2 .intro-sub{font-size:14px}
}
@media(max-width:440px){
 body[data-site-screen='chapter-05'] #screen2{grid-template-columns:minmax(0,1fr)}
 body[data-site-screen='chapter-05'] #screen2 .label{grid-column:1!important;grid-row:auto!important}
 body[data-site-screen='chapter-05'] #instToggleBtn{grid-area:8 / 1}
 body[data-site-screen='chapter-05'] #audioBtnMain{grid-area:9 / 1}
 body[data-site-screen='chapter-05'] #audioPreviewLabel{grid-area:10 / 1}
 body[data-site-screen='chapter-05'] #screen2Caption{grid-area:11 / 1}
}
@media(pointer:coarse){
 body button,body [role='button'],body .lang-opt{touch-action:manipulation}
 body .lang-opt{min-height:36px}
 #goldCursor,#cursorDot,#cursorRing{display:none!important}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
/* One chapter badge at each breakpoint; no duplicate abbreviated labels. */
body .bar-chapter-badge{max-width:calc(100vw - 150px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .bar-chapter-badge .badge-mono,body .bar-chapter-badge .badge-short{display:none!important}
@media(min-width:769px) and (max-width:1200px){body .bar-chapter-badge .badge-mono{display:inline!important}body .bar-chapter-badge .badge-en{display:none!important}}
@media(max-width:768px){body .bar-chapter-badge .badge-short{display:inline!important}body .bar-chapter-badge .badge-en{display:none!important}}
body[data-site-screen='chapter-05'] .lang-switcher{top:10px}
html[lang='en'] #label1 .label-sub,html[lang='en'] #label3 .label-sub{display:none}
@media(pointer:coarse){html,body,a,button,[role='button'],input,select,textarea{cursor:auto!important}}
body[data-site-screen='chapter-5-audition'] .screen{bottom:calc(8vh + 62px)}
body[data-site-screen='chapter-5-audition'] .attr-badge{bottom:calc(8vh + 12px)}
#foodFilterToggle{display:none}
@media(max-width:768px){
 #foodFilterToggle{display:block;position:absolute;top:64px;left:68px;z-index:25;min-height:36px;padding:8px 12px;border:1px solid var(--site-border);border-radius:6px;background:rgba(24,21,17,.94);color:#e6c17a;font:12px var(--site-interface)}
 body[data-site-screen='chapter-04'] #catFilter{display:none;top:108px;bottom:auto;left:68px;max-height:calc(100dvh - 240px);overflow-y:auto}
 body[data-site-screen='chapter-04'] .filters-open #catFilter{display:block}
}
@media(max-width:768px){
 body[data-site-screen='chapter-04'] .cinema-bar-top{justify-content:flex-start;padding-left:18px}
 body[data-site-screen='chapter-04'] .chapter-badge{max-width:calc(100vw - 160px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;letter-spacing:.02em}
 body[data-site-screen='chapter-04'] .lang-switcher{right:16px}
 body[data-site-screen='chapter-04'] .page-title-layer{top:12px;left:68px;right:18px}
 body[data-site-screen='chapter-04'] .title-main{font-size:21px;letter-spacing:.02em}
 body[data-site-screen='chapter-04'] .title-sub{font-size:11px;line-height:1.4;letter-spacing:.01em}
 body[data-site-screen='chapter-04'] .explore-counter{top:88px;left:68px;right:auto;padding:7px 12px;font-size:11px}
 body[data-site-screen='chapter-04'] .replay-btn{top:88px;right:18px;padding:7px 10px}
 body[data-site-screen='chapter-04'] #foodFilterToggle{top:132px}
 body[data-site-screen='chapter-04'] #catFilter{top:176px;max-height:calc(100dvh - 320px)}
 body[data-site-screen='chapter-04'] .screen{background-image:none}
 body[data-site-screen='chapter-04'] .map-container{inset:180px 0 0 60px;display:block;overflow:auto;padding:0 12px 24px;overscroll-behavior:contain}
 body[data-site-screen='chapter-04'] #silk-map{display:block;width:860px;height:484px;max-width:none;max-height:none;background:url('../assets/backgrounds/chapter-4-silk-road-map.jpg') center/100% 100% no-repeat}
 body[data-site-screen='chapter-04'] .detail-panel.open{right:16px;padding:32px 24px 24px}
}
