/* 20261113rm2: sources row stays put when the list opens, and a Related Media folder tab
   sits on the top edge of the sources box. Loaded after the live tour-panel sheets. */

/* The live row is a wrapping flex line. Opening the list gave the sources block
   order 2 and the buttons order 1, so Live Fact Check and Flag Content jumped
   above the sources line. Grid keeps that line as row 1 and drops the list under it. */
body:not(.owh-m) #tour-src-narr{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  column-gap:8px;
  row-gap:4px;
  position:relative;
}
body:not(.owh-m) #tour-src-narr::before{content:none !important;display:none !important}
body:not(.owh-m) #tour-src-narr #tour-src,
body:not(.owh-m) #tour-src-narr #tour-src[hidden]{
  display:contents !important;
  flex-basis:auto !important;
  order:0 !important;
  visibility:visible;
}
body:not(.owh-m) #tour-src-narr #tour-src[hidden]{visibility:hidden}
body:not(.owh-m) #tour-src-narr #tour-src > .src-toggle{
  grid-column:1;grid-row:1;justify-self:start;align-self:center;
  white-space:nowrap !important;overflow:hidden;text-overflow:ellipsis;max-width:100%;text-align:left;
  margin:0;padding:0;border:0;background:none;color:var(--muted);
  font:inherit;font-size:inherit;line-height:1.35;cursor:pointer;
}
body:not(.owh-m) #tour-src-narr #tour-src > .src-toggle:hover,
body:not(.owh-m) #tour-src-narr #tour-src > .src-toggle:focus-visible{color:var(--text)}
body:not(.owh-m) #tour-src-narr #tour-src > .src-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
body:not(.owh-m) #tour-src-narr #tour-src > .src-list{
  grid-column:1 / -1;grid-row:2;margin-top:2px;
  max-height:min(9.5em,28vh);overflow:auto;scrollbar-width:thin;
}
body:not(.owh-m) #tour-src-narr #tour-src > :not(.src-toggle):not(.src-list){grid-column:1 / -1}
body:not(.owh-m) #tour-src-narr > .tour-src-narr-tools{
  grid-column:2;grid-row:1;justify-self:end;align-self:center;
  width:auto;margin-left:0 !important;order:0 !important;flex-basis:auto !important;
}
body:not(.owh-m) #tour-src-narr:has(#tour-src .src-list:not([hidden])) #tour-src,
body:not(.owh-m) #tour-src-narr:has(#tour-src .src-list:not([hidden])) .tour-src-narr-tools{
  order:0 !important;flex-basis:auto !important;
}

/* Folder tab on the top edge of the sources box. It travels with the card,
   including the left stack, the floating picture window, and the bottom-left snap. */
.tour-rm-tab{
  position:absolute;left:12px;top:0;transform:translateY(calc(-100% + 1px));z-index:2;
  margin:0;padding:3px 11px 4px;border:1px solid var(--line);border-bottom:0;border-radius:8px 8px 0 0;
  background:var(--card,#0e1426);color:var(--text);
  font:650 11px/1.2 var(--font,Inter,system-ui,sans-serif);letter-spacing:.03em;cursor:pointer;
}
.tour-rm-tab[hidden]{display:none !important}
.tour-rm-tab:hover{color:var(--text);border-color:var(--accent)}
.tour-rm-tab:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tour-rm-tab[aria-expanded="true"]{background:var(--accent,#ffb547);color:#1a1408;border-color:var(--accent,#ffb547)}
body.tour-rm-has:not(.owh-m) #tour-src-narr{margin-top:28px}
body.tour-rm-open #tour-rm{padding-bottom:2px}
body.theme-light .tour-rm-tab{background:var(--card,#fffdf6)}
body.theme-light .tour-rm-tab[aria-expanded="true"]{background:var(--accent);color:#1a1408}

/* Open: the stop text is hidden and this list sits where it was. The sources box and the footer stay. */
#tour-rm{margin:2px 0 6px;min-height:0}
#tour-rm[hidden]{display:none !important}
body.tour-rm-open #tourbar :is(
  #tour-when,#tour-title,#tour-sensitive,#tour-readout,#tour-focus,#tour-text,#tour-card-note,
  #tour-review-notice,#tour-course-outline,#tour-events,.tour-battle-type,#battle-hold-note
){display:none !important}
/* The stop text scrolls. The sources box, its tab, and the footer stay above the timebar. */
#tour-scroll{flex:1 1 auto;min-height:0;overflow:auto;scrollbar-width:thin}
body.tour-rm-open #tour-scroll{display:none !important}
body.tour-left-stacked:not(.owh-m) #tour-left-stack{
  max-height:calc(100vh - 92px - 140px);
  max-height:calc(100dvh - 92px - 140px);
}
body.tour-left-stacked:not(.owh-m) #tour-left-stack #tourbar{
  min-height:0;max-height:100%;overflow:hidden;
}
body.tour-left-stacked:not(.owh-m) #tour-left-stack #tourbar > :is(
  .tour-head,#tour-src-narr,.tour-ctl,.tour-explore,#tour-rm,#tour-flag-row
){flex:0 0 auto}
body.tour-left-stacked.tour-rm-open #tour-left-stack #tour-rm,
body.tour-rm-open #tour-rm{flex:1 1 auto;max-height:min(46vh,420px);overflow:auto;scrollbar-width:thin}
body.tour-rm-open #tour-src-narr,body.tour-rm-open .tour-ctl{flex:0 0 auto}
.rm-head{display:flex;align-items:center;gap:8px;margin:0 0 6px}
.tour-rm-back{
  font:inherit;font-size:12px;font-weight:650;padding:3px 8px;border-radius:8px;cursor:pointer;
  color:var(--text);background:rgba(255,255,255,.07);border:1px solid var(--line);
}
.tour-rm-back:hover{border-color:var(--accent)}
.tour-rm-back:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rm-h{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:700}
.rm-sec{margin:0 0 6px;border:1px solid var(--line);border-radius:8px;background:rgba(255,255,255,.03)}
.rm-sec summary{
  cursor:pointer;padding:5px 8px;font-size:12px;font-weight:700;color:var(--text);list-style:none;
}
.rm-sec summary::-webkit-details-marker{display:none}
.rm-sec summary::before{content:"▸ ";color:var(--muted);font-weight:400}
.rm-sec[open] summary::before{content:"▾ "}
.rm-n{font-weight:500;color:var(--muted)}
.rm-list{list-style:none;margin:0;padding:0 8px 6px}
.rm-item{padding:6px 0;border-top:1px solid var(--line)}
.rm-item:first-child{border-top:0}
.rm-title{color:#9fb7e8;font-weight:650;text-decoration:none}
.rm-title:hover{text-decoration:underline}
.rm-year{margin-left:6px;color:var(--muted);font-size:12px}
.rm-meta{display:flex;flex-wrap:wrap;gap:3px 6px;align-items:center;margin-top:2px;font-size:11.5px;color:var(--muted)}
.rm-type{letter-spacing:.02em}
.rm-badge{
  font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  padding:1px 6px;border-radius:999px;border:1px solid;
}
.rm-free{color:#b7f0c2;border-color:rgba(126,224,138,.55)}
.rm-paid{color:#ffd7a1;border-color:rgba(255,181,71,.6)}
.rm-note,.rm-seg{margin:3px 0 0;font-size:12.5px;line-height:1.35;color:var(--text)}
.rm-seg{color:var(--muted)}
body.theme-light .rm-sec{background:rgba(30,45,90,.03)}
body.theme-light .rm-title{color:#1f4fbf}
body.theme-light .rm-free{color:#0d6b3a;border-color:rgba(13,107,58,.4)}
body.theme-light .rm-paid{color:#8a4b00;border-color:rgba(138,75,0,.4)}
body.theme-light .tour-rm-back{background:#fffdf6}

/* Laptop card (about 400–440px) and the short bottom-left snap: keep the tab and rows inside the box. */
@media (max-width:1439.98px){
  .tour-rm-tab{left:8px;padding:2px 8px 3px;font-size:10.5px}
  .rm-title{font-size:13px}
  .rm-note,.rm-seg{font-size:12px}
}
body.tour-left-stacked.tour-stack-short .tour-rm-tab{font-size:10.5px;padding:2px 8px 3px}
body.tour-left-stacked.tour-stack-short #tour-rm{max-height:min(34vh,280px)}

/* Phones keep their own sources column. The tab sits in the box instead of above a sticky edge. */
body.owh-m .tour-rm-tab{
  position:static;transform:none;display:inline-block;margin:0 0 4px;
  border-bottom:1px solid var(--line);border-radius:8px;
}
body.owh-m.tour-rm-has #tour-src-narr{margin-top:0}
body.owh-m.tour-rm-open #tour-rm{max-height:min(36vh,280px)}
