/* Section rail: a slim glass capsule of section icons in the left margin (laptops only); the logic is rail.js */
#srail { --w: 46px; position: fixed; top: 50%; z-index: 20; box-sizing: border-box;
  left: 14px; width: var(--w); padding: 8px 0; border-radius: 23px; overflow: hidden;
  background: rgba(32,20,17,.34); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,244,230,.1); box-shadow: inset 0 1px 0 rgba(255,244,230,.05), 0 12px 32px -18px rgba(0,0,0,.35);
  transition: width .34s cubic-bezier(.2,.8,.2,1), background .3s, opacity .3s; font: 500 13px/1 var(--ui, system-ui); }
#srail:hover, #srail:focus-within { --w: 220px; background: rgba(32,20,17,.62); border-color: rgba(255,244,230,.16); box-shadow: inset 0 1px 0 rgba(255,244,230,.08), 0 12px 32px -14px rgba(0,0,0,.5); }
#srail button { display: flex; align-items: center; width: 220px; height: 38px; padding: 0; border: 0; background: none; cursor: pointer;
  color: #FFF6EA; font: inherit; text-align: left; white-space: nowrap; transition: color .2s; }
#srail .lns { position: absolute; inset: 0; pointer-events: none; }
#srail .lns i { position: absolute; left: 21px; width: 2px; border-radius: 1px; background: #F2B66B; opacity: .85; }
:root:not([data-theme="night"]) #srail .lns i { background: #C4521C; }
#srail .ic { flex: none; width: 44px; height: 38px; display: grid; place-items: center; position: relative; }
#srail svg { position: relative; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#srail svg .f { fill: currentColor; stroke: none; }
#srail .lb { opacity: 0; transition: opacity .18s; }
#srail:hover .lb, #srail:focus-within .lb { opacity: 1; transition-delay: .1s; }
#srail button:focus-visible { outline: none; }
#srail button:not(.here):not(.later):hover .lb, #srail button:focus-visible .lb { text-decoration: underline; text-underline-offset: 3px; }
#srail button.here { color: #F2B66B; }
#srail button.here svg { stroke-width: 1.9; }
#srail button.here .lb { font-weight: 600; }
#srail button.later { color: rgba(255,244,230,.46); cursor: default; }
#srail button.later .lb::after { content: "  after a chase"; font-size: 11px; font-weight: 400; }
/* Dusk: a light frosted pill with ink icons (Night keeps the dark glass) */
:root:not([data-theme="night"]) #srail { background: rgba(255,248,238,.46); border-color: rgba(255,255,255,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 28px -16px rgba(60,30,15,.3); }
:root:not([data-theme="night"]) #srail:hover, :root:not([data-theme="night"]) #srail:focus-within { background: rgba(255,248,238,.86); border-color: rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 10px 28px -12px rgba(60,30,15,.45); }
:root:not([data-theme="night"]) #srail button { color: #2B1A13; }
:root:not([data-theme="night"]) #srail button.here { color: #C4521C; }
:root:not([data-theme="night"]) #srail button.later { color: rgba(46,28,20,.42); }
html.rail-hide #srail { opacity: 0; pointer-events: none; }
html.ld-on #srail { opacity: 0; pointer-events: none; }
html.spot #srail { opacity: .35; pointer-events: none; }
@media (max-height: 680px) { #srail button, #srail .ic { height: 32px; } }
@media (max-width: 900px), (hover: none) { #srail { display: none; } }

/* The charge (rail.js, owner 11 Nov): a skipped chase charges the stage icons bottom up, like cells of a battery */
#srail { --lit: #F2B66B; --lit-glow: rgba(242,182,107,.55); }
:root:not([data-theme="night"]) #srail { --lit: #C4521C; --lit-glow: rgba(196,82,28,.38); }
#srail .ic svg.chg { position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -9px; color: var(--lit); stroke-width: 1.9; pointer-events: none;
  clip-path: inset(calc((1 - var(--q, 0)) * 100%) 0 0 0); opacity: 0; transition: opacity .5s ease; }
#srail .ic .mn { position: absolute; left: 50%; width: 20px; height: 1.5px; margin-left: -10px; border-radius: 1px; pointer-events: none; opacity: 0;
  top: calc(50% - 9px + (1 - var(--q, 0)) * 18px); background: linear-gradient(90deg, transparent, var(--lit) 22%, var(--lit) 78%, transparent);
  box-shadow: 0 0 6px 1px var(--lit-glow); transition: opacity .25s ease; }
#srail.chargemode { opacity: 1 !important; }
#srail.chargemode .ic svg.chg { opacity: 1; }
#srail.chargemode button:is([data-k="goal"], [data-k="fail"], [data-k="pred"], [data-k="fly"], [data-k="echo"], [data-k="ledger"]):not(.full) svg.base { opacity: .5; }
#srail.chargemode button.here { color: inherit; }
#srail.chargemode button.charging .mn { opacity: .8; }
#srail.chargemode button.full svg.base { opacity: 0; }
#srail.chargemode button.full svg.chg { animation: srail-cell .42s cubic-bezier(.2,.8,.2,1); }
@keyframes srail-cell { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }
#srail.charged .lns i { box-shadow: 0 0 6px var(--lit-glow); }
#srail.discharge .ic svg.chg { opacity: 0; }
#srail.discharge svg.base { transition: opacity .5s ease; }
@media (prefers-reduced-motion: reduce) { #srail.chargemode button.full svg.chg { animation: none; } #srail .ic .mn { display: none; } }
