/* One URL, one story: phone layout never changes release or decision rights. */
.mobile-reader-bar{display:none}
@media(max-width:800px){
  :root{--workspace-top:166px}
  body{padding-top:106px;padding-bottom:env(safe-area-inset-bottom,0px)}
  .quick-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));inset:0 0 auto;width:100%;padding:8px max(12px,env(safe-area-inset-right));gap:4px;min-height:100px}
  .quick-nav .workspace-brand{grid-column:1/-1;margin:0;justify-self:center;font-size:1rem;line-height:1.7;white-space:normal;text-align:center}
  .quick-nav button{width:100%;min-width:0;min-height:44px;padding:8px 4px;font-size:.875rem}
  .reader,.common-reader,.common-info-page{width:100%;padding:18px 12px 40px;margin:0}
  .reader-intro{display:block;margin:0 0 16px}.reader-intro h2{font-size:1.7rem}.reader-intro .reading-guide{margin:8px 0;padding:8px 12px;font-size:.875rem}
  .reading-workspace{display:flex;flex-direction:column;gap:12px;min-width:0}
  .reading-workspace>*{min-width:0;max-width:100%;width:100%}
  /* Also keep the chapter list readable if the optional menu script fails. */
  .reading-workspace>#chapterTabs{display:flex;flex-direction:column;align-items:stretch;position:static;gap:8px;width:100%;max-height:none;overflow:visible;padding:0;margin:0}
  .reading-workspace>#chapterTabs>button{flex:0 0 auto;display:grid;grid-template-columns:28px minmax(0,1fr);width:100%;min-width:0;min-height:76px;height:auto;padding:12px 14px;gap:4px 12px;text-align:left;writing-mode:horizontal-tb}
  .reading-workspace>#chapterTabs>button>b,.reading-workspace>#chapterTabs>button>small{width:100%;min-width:0;white-space:normal;word-break:normal;overflow-wrap:break-word;text-align:left;line-height:1.6}
  .reading-workspace>#chapterTabs>button>b{font-size:1rem}.reading-workspace>#chapterTabs>button>small{font-size:.875rem}
  .mobile-reader-bar{display:flex;gap:8px;position:sticky;top:100px;z-index:25;background:#091321;padding:8px 0;order:-3}
  .mobile-reader-bar button{flex:1;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #62788e;border-radius:8px;background:#11283a;color:#e6edf4;font-size:1rem}
  .mobile-reader-bar button[aria-expanded=true]{border-color:#d9bb72;color:#f4dfa9;background:#253649}
  .reading-workspace:has(>.mobile-reader-bar)>.reading-tabs,.reading-workspace:has(>.mobile-reader-bar)>.chapter-tabs,.reading-workspace:has(>.mobile-reader-bar)>.reader-tools{display:none}
  .reading-workspace.mobile-nav-open>.reading-tabs,.reading-workspace.mobile-nav-open>.chapter-tabs{display:flex;flex-direction:column;position:static;order:-2;max-height:none;overflow:visible;margin:0;padding:12px;border:1px solid #425970;border-radius:10px;background:#0b1b2b}
  .reading-workspace:has(>.mobile-reader-bar)>#chapterTabs{display:none}
  .reading-workspace.mobile-nav-open:has(>.mobile-reader-bar)>#chapterTabs{display:flex;order:-2;padding:12px}
  .reading-workspace.mobile-tools-open>.reader-tools{display:flex;position:static;order:-2;flex-direction:row;flex-wrap:wrap;max-height:none;overflow:visible;margin:0;padding:12px;border:1px solid #425970;border-radius:10px;background:#0b1b2b}
  .reading-workspace .reader-tools button,.reading-workspace .reader-tools label{min-width:0;flex:1 1 130px;min-height:44px;font-size:1rem}
  .reading-workspace .reader-tools select{font-size:1rem;min-height:44px}.reading-workspace .reader-tools .chapter-toc{flex-basis:100%}
  .reading-workspace .reader-tools #readerHome,.reading-workspace .reader-tools #readingBack{margin:12px 0 0}
  .reading-workspace>.chapter-panel,.reading-workspace>.workflow-panel{position:static;margin:0;width:100%;min-width:0;scroll-margin-top:166px}
  .reading-workspace .text-panel{padding:20px 16px;font-size:var(--reader-size);line-height:1.9}
  .reading-workspace #actionSummary{margin:16px;padding:16px;border-radius:12px}.reading-workspace #actionSummary h3{font-size:1.15rem;margin:0 0 12px}.reading-workspace #actionSummary li{font-size:1rem;line-height:1.8}
  .reading-workspace .workflow-panel{padding:18px 14px}
  .reading-workspace .chapter-heading{padding:22px 16px}.reading-workspace .chapter-heading h3{font-size:1.65rem;overflow-wrap:anywhere}
  .reading-workspace .dialogue-row{gap:8px;max-width:100%;transform:none}
  .reading-workspace .dialogue-avatar{width:40px;height:40px;flex:0 0 40px}
  .reading-workspace .dialogue-bubble{min-width:0;max-width:calc(100% - 48px);padding:12px;overflow-wrap:anywhere}
  .reading-workspace .story-marker{scroll-margin-top:166px;overflow-wrap:anywhere}
  .reading-workspace .pair-scene-cover{padding:24px 18px;min-height:200px;margin-bottom:20px}
  .result-page .choice-pair-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .result-page .choice-pair-tabs .flow-step{padding:8px 5px;min-width:0;min-height:48px}.result-page .choice-pair-tabs b{font-size:.875rem;overflow-wrap:anywhere}
  .result-page[data-stage=choices] .route-choice-card,.result-page .gm-choice-grid .route-choice-card{display:flex;flex-direction:column;min-height:0;padding:16px;gap:12px;margin:12px 0}
  .result-page[data-stage=choices] .route-choice-card>.choice-cast,.result-page .gm-choice-grid .route-choice-card>.choice-cast{width:100%;height:220px;order:0;margin:0}
  .result-page .route-choice-card>p{order:-1}
  .result-page .route-choice-card>button{order:1;width:100%;min-height:56px;margin:0;padding:12px 14px;font-size:1rem;text-align:left;justify-content:flex-start}
  .result-page .gm-choice-grid{grid-template-columns:minmax(0,1fr)}
  .result-page>button,.next-step>button{width:100%;min-height:48px;white-space:normal;padding:12px 16px;font-size:1rem}
  .result-page>textarea{font-size:1rem!important;min-height:90px!important;height:auto!important}
  .result-page>h3{font-size:1.7rem!important;line-height:1.5;overflow-wrap:anywhere}
  .announced-options,.vote-picker,.vote-options{grid-template-columns:repeat(2,minmax(0,1fr))}
  .common-info-page .common-card-grid{grid-template-columns:minmax(0,1fr)}
  .location-guide{grid-template-columns:minmax(0,1fr);min-height:0}.location-art{height:200px}.location-copy{padding:22px 18px}.location-copy .section-label{font-size:.875rem}
  .interactive-map .map-hotspot{min-height:44px;font-size:.875rem;padding:6px}
  .modal{padding:12px}.modal-card,.guide-card{max-width:100%;max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
  .character-confirm-card{display:flex;flex-direction:column;width:100%}.character-detail-art{height:240px;min-height:0}.character-detail-art img{height:100%;object-fit:contain}
  .character-detail-copy{padding:22px 18px}.character-detail-rail{padding:0 16px 20px;flex-wrap:wrap}
  .guide-card:has(.cast-guide){padding:44px 18px 22px}.cast-guide{display:block}.cast-guide>img{height:240px;width:100%}
  .story-marker.afterword-profile{display:flex!important;flex-direction:column;padding:16px!important}.story-marker.afterword-profile>.marker-avatar{width:100%;height:240px!important;min-height:0!important}.story-marker.afterword-profile>.afterword-profile-copy{padding:0!important}
  .gm-console{padding:16px}.gm-console-head{gap:12px}.gm-console-head h2{font-size:1.5rem}.gm-guide-grid{grid-template-columns:minmax(0,1fr)}
  button,a,input,select,textarea{touch-action:manipulation}input,select,textarea{max-width:100%}
}
