/* STEP2918 - Front-end ordinary post only. The middle column retains its 820px geometry. */
.fpsj-theme .fpsj-single .fpsj-rails-layout{display:block;position:relative;width:100%;min-width:0;margin:0 auto;max-width:none;}
.fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-reading-surface{min-width:0;max-width:100%;width:100%;}
.fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail{display:none;min-width:0;box-sizing:border-box;color:#e3edfd;font-size:13px;line-height:1.5;}
.fpsj-theme .fpsj-rail :is(h2,p){margin:0;}
.fpsj-theme .fpsj-rail :is(a,a:visited){color:#e8f4ff;text-decoration:none;}
.fpsj-theme .fpsj-rail a:focus-visible{outline:2px solid #31d7ff;outline-offset:3px;border-radius:5px;}
.fpsj-theme .fpsj-rail-toc,.fpsj-theme .fpsj-rail-right-inner{position:sticky;top:calc(var(--wp-admin--admin-bar--height,0px) + 96px);max-height:calc(100dvh - var(--wp-admin--admin-bar--height,0px) - 120px);overflow:auto;scrollbar-width:thin;overscroll-behavior:contain;}
.fpsj-theme .fpsj-rail-toc{border:1px solid #28415e;border-radius:12px;background:#101e32;padding:15px 12px;}
.fpsj-theme .fpsj-rail-toc-heading,.fpsj-theme .fpsj-rail-heading{font-size:13px;font-weight:800;letter-spacing:.02em;color:#e9f7ff;}
.fpsj-theme .fpsj-rail-toc-heading{padding-bottom:10px;border-bottom:1px solid #294562;}
.fpsj-theme .fpsj-rail-toc-items{padding:8px 0;margin:0;list-style:none;}
.fpsj-theme .fpsj-rail-toc-items li{margin:0;}
.fpsj-theme .fpsj-rail .fpsj-rail-toc-link{display:block;border-left:3px solid transparent;padding:7px 6px 7px 9px;border-radius:0 6px 6px 0;color:#c5d6ea;font-size:12px;line-height:1.55;overflow-wrap:anywhere;transition:background-color .16s ease;}
.fpsj-theme .fpsj-rail .fpsj-rail-toc-link:hover,.fpsj-theme .fpsj-rail .fpsj-rail-toc-link.is-active{background:rgba(49,215,255,.10);border-left-color:#31d7ff;color:#f3fbff;}
.fpsj-theme .fpsj-rail .fpsj-rail-toc-link.is-h3{padding-left:18px;font-size:11px;color:#b3c7dd;}
.fpsj-theme .fpsj-rail-backtop{display:block;border-top:1px solid #294562;padding:12px 8px 0;font-size:11px;}
.fpsj-theme .fpsj-rail-section{border:1px solid #28415e;border-radius:12px;background:#101e32;padding:14px 12px;margin-bottom:12px;}
.fpsj-theme .fpsj-rail-heading{margin-bottom:11px!important;}
.fpsj-theme .fpsj-rail .fpsj-rail-related-link{display:grid;grid-template-columns:58px minmax(0,1fr) 10px;gap:8px;align-items:center;padding:9px 0;border-top:1px solid #28415e;}
.fpsj-theme .fpsj-rail .fpsj-rail-related-link:hover .fpsj-rail-related-title{text-decoration:underline;text-decoration-color:#31d7ff;}
.fpsj-theme .fpsj-rail-related-thumb{display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;border-radius:7px;overflow:hidden;background:#183554;color:#91bce2;font-size:10px;font-weight:800;}
.fpsj-theme .fpsj-rail-related-thumb img{display:block;width:100%;height:100%;object-fit:cover;}
.fpsj-theme .fpsj-rail-related-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:12px;font-weight:650;line-height:1.5;overflow-wrap:anywhere;}
.fpsj-theme .fpsj-rail-related-arrow{color:#54d6ff;}
/* STEP2928: small factual title-based guide cue, not a paid badge. */
.fpsj-theme .fpsj-rail-related-guide{display:inline-block;margin-top:4px;padding:1px 5px;border:1px solid #4a7195;border-radius:4px;color:#c8e9ff;font-size:10px;line-height:1.45;font-weight:650;}
.fpsj-theme .fpsj-rail .fpsj-rail-tool-link{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #31567b;border-radius:9px;background:#162b47;}
.fpsj-theme .fpsj-rail .fpsj-rail-tool-link:hover{border-color:#31d7ff;}
.fpsj-theme .fpsj-rail-tool-link > span:nth-child(2){flex:1;min-width:0;}
.fpsj-theme .fpsj-rail-tool-link strong,.fpsj-theme .fpsj-rail-tool-link small{display:block;}
.fpsj-theme .fpsj-rail-tool-link small{font-size:10px;color:#b7cbe0;margin-top:2px;}
.fpsj-theme .fpsj-rail-tool-icon{font-size:20px;color:#31d7ff;}
/* A roomier desktop gains the discovery rail. Layout stays out of database/player pages. */
@media(min-width:1200px){
 .fpsj-theme .fpsj-single .fpsj-rails-layout{left:50%;transform:translateX(-50%);width:min(1100px,calc(100vw - 44px));display:grid;grid-template-columns:minmax(0,820px) minmax(200px,240px);justify-content:center;align-items:start;gap:24px;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-right{display:block;grid-column:2;grid-row:1;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-reading-surface{grid-column:1;grid-row:1;}
}
@media(min-width:1500px){
 .fpsj-theme .fpsj-single .fpsj-rails-layout{width:min(1370px,calc(100vw - 56px));grid-template-columns:minmax(192px,220px) minmax(0,820px) minmax(210px,240px);gap:24px;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-left{display:block;grid-column:1;grid-row:1;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-reading-surface{grid-column:2;grid-row:1;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-right{grid-column:3;grid-row:1;}
}
.fpsj-theme .fpsj-rails-layout .wp-block-post-content :is(h2,h3)[id]{scroll-margin-top:110px;}
@media(prefers-reduced-motion:reduce){.fpsj-theme .fpsj-rail .fpsj-rail-toc-link{transition:none;}}

/* STEP2920: Staging LTT rail acceptance fix.
   Keep LTT's rendered anchor markup and click handling intact.  Only the outer
   rail owns sticky geometry; neutralize nested sticky/white panel styling in
   this specifically-scoped frontend rail.  LTT's in-article TOC is untouched. */
@media (min-width:1200px){
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-right{
  align-self:stretch;
  position:relative;
  height:auto;
 }
 .fpsj-theme .fpsj-rail-right-inner{
  top:calc(var(--wp-admin--admin-bar--height,0px) + 20px);
  max-height:calc(100dvh - var(--wp-admin--admin-bar--height,0px) - 40px);
 }
}
@media (min-width:1500px){
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-left{
  align-self:stretch;
  position:relative;
  height:auto;
  min-height:100%;
 }
 .fpsj-theme .fpsj-rail-ltt-shell{
  position:sticky;
  top:calc(var(--wp-admin--admin-bar--height,0px) + 20px);
  width:100%;
  max-width:100%;
  max-height:calc(100dvh - var(--wp-admin--admin-bar--height,0px) - 40px);
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  box-sizing:border-box;
  border:1px solid #28415e;
  border-radius:12px;
  background:#101e32;
  padding:12px 11px;
  color:#ecf4ff;
  font-size:12px;
  line-height:1.6;
 }
 /* The plugin brings its own light surface and position rules.
    Its DOM stays intact so event delegation, data attributes and links work. */
 .fpsj-theme .fpsj-rail-ltt-shell :is(nav,aside,section,div,ol,ul){
  box-sizing:border-box;
  max-width:100%!important;
  min-width:0!important;
  box-shadow:none!important;
  background-color:transparent!important;
  background-image:none!important;
 }
 .fpsj-theme .fpsj-rail-ltt-shell :is(nav,aside,section){
  position:static!important;
  inset:auto!important;
  transform:none!important;
 }
 .fpsj-theme .fpsj-rail-ltt-shell > *{
  position:static!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow:visible!important;
  max-height:none!important;
 }
 .fpsj-theme .fpsj-rail-ltt-shell :is(ol,ul){
  margin:7px 0 0!important;
  padding:0 0 0 17px!important;
 }
 .fpsj-theme .fpsj-rail-ltt-shell li{
  margin:0!important;
  padding:0!important;
  font-size:12px!important;
  line-height:1.6!important;
  color:#bdcfe5!important;
  overflow-wrap:anywhere;
 }
 .fpsj-theme .fpsj-rail-ltt-shell li::marker{color:#8dadcd;}
 .fpsj-theme .fpsj-rail-ltt-shell a,
 .fpsj-theme .fpsj-rail-ltt-shell a:visited{
  display:inline-block;
  width:auto;
  max-width:100%;
  padding:4px 2px!important;
  font-size:12px!important;
  line-height:1.55!important;
  font-weight:550;
  text-decoration:none!important;
  overflow-wrap:anywhere;
  color:#dceafe!important;
  background:transparent!important;
  border:0!important;
 }
 .fpsj-theme .fpsj-rail-ltt-shell a:hover,
 .fpsj-theme .fpsj-rail-ltt-shell a:focus-visible{
  color:#fff!important;
  text-decoration:underline!important;
  text-underline-offset:3px;
 }
 .fpsj-theme .fpsj-rail-ltt-shell :is(h2,h3,h4,strong,b){
  color:#f6fbff!important;
  font-size:13px!important;
  font-weight:750!important;
  line-height:1.45;
  overflow-wrap:anywhere;
 }
 .fpsj-theme .fpsj-rail-ltt-shell button{
  max-width:100%;
  min-height:27px;
  padding:4px 8px;
  border:1px solid #52759e!important;
  border-radius:6px;
  background:#1a3555!important;
  color:#f1f8ff!important;
  font-size:11px!important;
  cursor:pointer;
 }
 .fpsj-theme .fpsj-rail-ltt-shell :is(a,button):focus-visible{
  outline:2px solid #31d7ff!important;
  outline-offset:2px!important;
 }
}

/* STEP2921: Usable-viewport-first layout, preserving normal article canvas.
 * Former 1500px triple-rail breakpoint squeezed the article in split browsers;
 * allow a full 1040px editorial canvas when room exists, and move the left
 * TOC aside behind a 1680 CSS-pixel breakpoint. LTT markup is unchanged.
 */
@media (min-width:1200px) and (max-width:1679.98px){
 .fpsj-theme .fpsj-single .fpsj-rails-layout{
  left:50%;transform:translateX(-50%);
  width:min(1280px,calc(100vw - 64px));
  max-width:none;
  display:grid;
  grid-template-columns:minmax(0,1040px) minmax(210px,240px);
  gap:clamp(18px,1.5vw,24px);
  justify-content:center;
  align-items:start;
 }
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-left{display:none!important;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-reading-surface{grid-column:1;grid-row:1;min-width:0;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-right{display:block;grid-column:2;grid-row:1;min-width:0;}
}
@media (min-width:1680px){
 .fpsj-theme .fpsj-single .fpsj-rails-layout{
  left:50%;transform:translateX(-50%);
  width:min(1680px,calc(100vw - 64px));
  max-width:none;
  display:grid;
  grid-template-columns:minmax(214px,240px) minmax(0,1040px) minmax(228px,260px);
  gap:clamp(18px,1.45vw,26px);
  justify-content:center;
  align-items:start;
 }
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-left{display:block;grid-column:1;grid-row:1;min-width:0;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-reading-surface{grid-column:2;grid-row:1;min-width:0;}
 .fpsj-theme .fpsj-single .fpsj-rails-layout > .fpsj-rail-right{display:block;grid-column:3;grid-row:1;min-width:0;}
}
/* Distinct reading-location visual. LTT keeps the DOM, anchors, tracking and
 * its own active-state logic; Theme adds a purely visual class for robust
 * highlighting when LTT's class selectors vary across plugin versions. */
@media (min-width:1680px){
 .fpsj-theme .fpsj-rail-ltt-shell a.fpsj-ltt-reading-active,
 .fpsj-theme .fpsj-rail-ltt-shell a.fpsj-ltt-reading-active:visited{
  display:block!important;
  width:100%!important;
  box-sizing:border-box;
  margin:2px 0!important;
  padding:7px 7px 7px 9px!important;
  background:#155e82!important;
  border-left:4px solid #45e2ff!important;
  border-radius:5px!important;
  color:#fff!important;
  font-weight:800!important;
  text-decoration:none!important;
 }
 .fpsj-theme .fpsj-rail-ltt-shell a.fpsj-ltt-reading-active:hover,
 .fpsj-theme .fpsj-rail-ltt-shell a.fpsj-ltt-reading-active:focus-visible{
  background:#1b7298!important;
 }
}


/* STEP2922: LTT sidebar TOC title contrast only.
 * LTT's current-position highlight, click tracking, and sticky geometry remain
 * unchanged. The real plugin may emit the panel title as a span/div rather than
 * h2/h3, so the STEP2920 h2/h3 rule alone misses its dark default color.
 * Scope the override to the desktop LTT rail, never the inline article TOC. */
@media (min-width:1680px){
 .fpsj-theme .fpsj-single .fpsj-rail-ltt-shell :is(
   [class*="title" i], [class*="heading" i],
   [class*="header" i], [class*="head" i]
 ):not(a):not(button){
  color:#f6fbff!important;
 }
 .fpsj-theme .fpsj-single .fpsj-rail-ltt-shell :is(
   [class*="title" i], [class*="heading" i],
   [class*="header" i], [class*="head" i]
 ) :is(span,strong,b,p):not(a):not(button){
  color:#f6fbff!important;
 }
 /* Fallback for LTT versions whose first panel heading has no semantic class. */
 .fpsj-theme .fpsj-single .fpsj-rail-ltt-shell > :first-child >
 :first-child:not(ol):not(ul):not(a):not(button){
  color:#f6fbff!important;
 }
 .fpsj-theme .fpsj-single .fpsj-rail-ltt-shell > :first-child >
 :first-child:not(ol):not(ul):not(a):not(button) :is(span,strong,b,p){
  color:#f6fbff!important;
 }
}

/* STEP2923: contextual discovery, scoped to the existing right rail only. */
.fpsj-theme .fpsj-rail .fpsj-rail-related-context{grid-template-columns:56px minmax(0,1fr) 9px;gap:9px;align-items:start;}
.fpsj-theme .fpsj-rail-related-context .fpsj-rail-related-copy{display:block;min-width:0;}
.fpsj-theme .fpsj-rail-related-context .fpsj-rail-related-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-weight:750;color:#f2f8ff;}
.fpsj-theme .fpsj-rail-related-reason{display:block;margin-top:5px;font-size:10px;line-height:1.5;font-weight:700;color:#69ddff;overflow-wrap:anywhere;}
.fpsj-theme .fpsj-rail-related-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-top:3px;font-size:10px;line-height:1.5;color:#bdd1e8;overflow-wrap:anywhere;}
.fpsj-theme .fpsj-rail .fpsj-rail-related-context:hover{background:rgba(50,190,255,.055);}
.fpsj-theme .fpsj-rail .fpsj-rail-related-context:focus-visible{outline:2px solid #31d7ff;outline-offset:2px;}
