
/* Star overlay is now bounded by the ACTIVE section. It cannot add scrollable height to body. */
.tab-panel:not([hidden]){position:relative}
#beta581StarPageLayer{
  position:absolute!important;inset:0!important;left:0!important;top:0!important;
  width:100%!important;height:100%!important;overflow:hidden!important;
  contain:paint!important;pointer-events:none!important;z-index:645!important;
}
#beta581StarPageLayer .beta581-star{pointer-events:auto}
/* Never allow the old scroll-preservation shim to dictate a section's final height. */
.tab-panel.tab-scroll-held{min-height:0!important}

/* NITI / ARCS: one elegant horizontal shelf per story arc instead of an endless wall downward. */
#threads .thread-arc-group{
  margin-bottom:15px!important;
  border-color:color-mix(in srgb,var(--arc-color,#d2b174) 20%,rgba(210,177,116,.12))!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--arc-color,#d2b174) 4%,rgba(24,22,30,.78)),rgba(12,12,17,.68))!important;
  box-shadow:0 14px 34px rgba(0,0,0,.16),inset 0 1px rgba(255,255,255,.018);
}
#threads .thread-arc-header{padding:12px 14px!important}
#threads .thread-arc-glyph{width:35px!important;height:35px!important;border-radius:11px!important;font-size:19px!important}
#threads .thread-arc-title strong{font-size:18px!important}
#threads .thread-arc-body{position:relative;padding:11px 12px 8px!important;overflow:hidden}
#threads .thread-arc-grid{
  display:grid!important;
  grid-template-columns:none!important;
  grid-auto-flow:column!important;
  grid-auto-columns:clamp(325px,36vw,420px)!important;
  gap:12px!important;align-items:start!important;
  overflow-x:auto!important;overflow-y:hidden!important;
  padding:2px 2px 10px!important;
  scroll-snap-type:x proximity;scroll-padding-inline:2px;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
  scrollbar-color:color-mix(in srgb,var(--arc-color,#d2b174) 36%,transparent) rgba(255,255,255,.025);
}
#threads .thread-arc-grid::-webkit-scrollbar{height:7px}
#threads .thread-arc-grid::-webkit-scrollbar-track{background:rgba(255,255,255,.025);border-radius:999px}
#threads .thread-arc-grid::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--arc-color,#d2b174) 34%,rgba(255,255,255,.06));border-radius:999px}
#threads .thread-workspace.view-arcs .thread-card{
  width:100%!important;min-width:0!important;margin-left:0!important;align-self:start!important;
  scroll-snap-align:start;
  padding:16px!important;border-radius:17px!important;
  background:linear-gradient(155deg,color-mix(in srgb,var(--thread-color) 7%,rgba(34,31,40,.96)),rgba(18,18,24,.97))!important;
  box-shadow:0 12px 28px rgba(0,0,0,.19)!important;
}
#threads .thread-workspace.view-arcs .thread-card::after{width:115px!important;height:115px!important;right:-62px!important;top:-66px!important}
#threads .thread-workspace.view-arcs .thread-card h4{font-size:21px!important;line-height:1.08!important;margin:5px 0 7px!important}
#threads .thread-workspace.view-arcs .thread-card>p{
  margin:10px 0 8px!important;min-height:0!important;
  color:color-mix(in srgb,var(--muted) 92%,#fff)!important;
  font-size:12.5px!important;line-height:1.5!important;
  display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:3!important;overflow:hidden!important;
}
#threads .thread-workspace.view-arcs .thread-quest-meta{margin:7px 0!important;gap:5px!important}
#threads .thread-workspace.view-arcs .thread-meta-pill{padding:4px 7px!important;font-size:9.5px!important}
#threads .thread-workspace.view-arcs .thread-progress{margin:10px 0 5px!important;height:6px!important}
#threads .thread-workspace.view-arcs .thread-objective-mini{margin:8px 0 4px!important}
#threads .thread-workspace.view-arcs .thread-links{
  display:flex!important;flex-wrap:nowrap!important;overflow:hidden!important;max-height:29px!important;gap:5px!important;margin-top:9px!important;
}
#threads .thread-workspace.view-arcs .thread-link{flex:0 0 auto!important;white-space:nowrap!important;max-width:145px!important;overflow:hidden!important;text-overflow:ellipsis!important}
#threads .thread-workspace.view-arcs .thread-quest-tags{display:none!important}
#threads .thread-workspace.view-arcs .thread-card-footer{margin-top:10px!important;padding-top:8px;border-top:1px solid rgba(255,255,255,.045)}
#threads .thread-workspace.view-arcs .thread-open-hint{font-size:9.5px!important;opacity:.72}
#threads .thread-workspace.view-arcs .thread-parent-note{margin-bottom:5px!important}

/* On phones each arc becomes a swipeable one-card shelf too: quests still do not run endlessly downward. */
@media(max-width:760px){
  #threads .thread-arc-body{padding:9px 8px 6px!important}
  #threads .thread-arc-grid{
    grid-template-columns:none!important;grid-auto-flow:column!important;
    grid-auto-columns:min(86vw,350px)!important;gap:10px!important;
    overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory;
  }
  #threads .thread-workspace.view-arcs .thread-card{padding:14px!important}
  #threads .thread-workspace.view-arcs .thread-card>p{-webkit-line-clamp:3!important}
}
