/* ROLE_TALK_READTHROUGH_STICKY_20261018
   Reading view only, for host/participant/spectator.
   Desktop: retain BOTH existing sidebar panels with inner scroll on short viewports.
   Phone: keep script readable; pin small shared status/controls/help toolbar.
   Do not change readiness, recording, room sync, script, or spectator authorization. */
.room-main.readthrough-view .readthrough-mobile-toolbar{display:none}
@media (min-width:751px){
 .room-main.readthrough-view .reading-grid > .reading-aside{
  position:sticky;
  top:calc(var(--header-height,56px) + 12px);
  align-self:start;
  max-height:calc(100vh - var(--header-height,56px) - 24px);
  max-height:calc(100dvh - var(--header-height,56px) - 24px);
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior-y:contain;
  scrollbar-gutter:stable;
  padding:2px;
  z-index:2;
 }
 .room-main.readthrough-view .reading-grid > .reading-aside .panel{
  min-width:0;
 }
}
@media (max-width:750px){
 .room-main.readthrough-view{
  padding-bottom:calc(118px + env(safe-area-inset-bottom,0px));
 }
 .room-main.readthrough-view .reading-grid > .reading-aside{
  position:static;
  max-height:none;
  overflow:visible;
 }
 .room-main.readthrough-view .readthrough-mobile-toolbar{
  box-sizing:border-box;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:100;
  border-top:2px solid var(--gold,#aa864d);
  background:var(--paper,#fffcf6);
  padding:8px max(12px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));
  box-shadow:0 -8px 22px rgba(45,22,14,.15);
  font-size:13px;
  line-height:1.3;
  min-height:60px;
 }
 .room-main.readthrough-view .readthrough-mobile-ready-count{
  flex:1 1 90px;
  min-width:0;
  font-size:12px;
  color:var(--wine,#521c2b);
  font-weight:600;
  overflow-wrap:anywhere;
 }
 .room-main.readthrough-view .readthrough-mobile-toolbar button{
  width:auto;
  flex:1 1 130px;
  min-width:112px;
  min-height:44px;
  padding:8px 10px;
  font-size:14px;
  line-height:1.25;
  margin:0;
 }

}
@media (max-width:370px){
 .room-main.readthrough-view .readthrough-mobile-toolbar{
  gap:5px;
  padding-top:6px;
  padding-bottom:calc(6px + env(safe-area-inset-bottom,0px));
 }
 .room-main.readthrough-view .readthrough-mobile-ready-count{flex-basis:78px;font-size:11px}
 .room-main.readthrough-view .readthrough-mobile-jump label{font-size:11px}
 .room-main.readthrough-view .readthrough-mobile-toolbar button{font-size:13px;min-width:106px}
}

/* READTHROUGH_JUMP_AND_HEADER_OFFSET_20261018
   The header height is measured by existing syncFixedHeader() via ResizeObserver.
   Jumping only scrolls to already rendered lines, never changes run state. */
.room-main.readthrough-view .script-line[id]{
 scroll-margin-top:0; /* global html scroll-padding already compensates for fixed header */
}
.room-main.readthrough-view .readthrough-jump-form{
 margin-top:12px;
 min-width:0;
}
.room-main.readthrough-view .readthrough-jump-form label{
 display:block;
 font-size:13px;
 line-height:1.4;
 color:var(--muted,#746565);
 margin-bottom:6px;
}
.room-main.readthrough-view .readthrough-jump-fields{
 display:grid;
 grid-template-columns:minmax(0,1fr) auto;
 align-items:stretch;
 gap:8px;
}
.room-main.readthrough-view .readthrough-jump-form input{
 box-sizing:border-box;
 width:100%;
 min-width:0;
 border:1px solid var(--line,#daccb6);
 border-radius:7px;
 background:var(--paper,#fffcf6);
 padding:7px 10px;
 font-size:16px;
 min-height:40px;
 color:var(--ink,#342728);
}
.room-main.readthrough-view .readthrough-jump-form button{
 box-sizing:border-box;
 min-height:40px;
 width:auto;
 padding:7px 16px;
 margin:0;
 font-size:14px;
}
.room-main.readthrough-view .readthrough-jump-status{
 display:block;
 font-size:12px;
 line-height:1.5;
 color:var(--muted,#746565);
 margin-top:6px;
}
.room-main.readthrough-view .readthrough-jump-status:empty{display:none;}
@keyframes readthrough-jump-emphasis{
 0%{box-shadow:inset 0 0 0 3px var(--gold,#aa864d);}
 100%{box-shadow:inset 0 0 0 0 transparent;}
}
.room-main.readthrough-view .script-line.readthrough-jump-flash{
 animation:readthrough-jump-emphasis 1.4s ease-out;
}
@media (prefers-reduced-motion:reduce){
 .room-main.readthrough-view .script-line.readthrough-jump-flash{animation:none;}
}
@media (max-width:750px){
 .room-main.readthrough-view .readthrough-mobile-jump{
  margin:0;
  flex:1 1 155px;
  display:grid;
  grid-template-columns:minmax(52px,1fr) auto;
  align-items:center;
  column-gap:6px;
  row-gap:3px;
 }
 .room-main.readthrough-view .readthrough-mobile-jump label{
  grid-column:1 / -1;
  margin:0;
  font-size:11px;
  line-height:1.1;
 }
 .room-main.readthrough-view .readthrough-mobile-jump input{
  min-height:40px;
  height:40px;
  padding:6px;
  font-size:16px;
 }
 .room-main.readthrough-view .readthrough-mobile-jump button{
  flex:none;
  min-width:50px;
  min-height:40px;
  padding:6px 8px;
  font-size:13px;
 }
 .room-main.readthrough-view .readthrough-mobile-jump .readthrough-jump-status{
  grid-column:1 / -1;
  margin:0;
  font-size:11px;
  max-height:2.8em;
  overflow:hidden;
 }
}
