/* The shell and the crest rail (views/_crestRail.js, t-p15-qob1ri): a thin strip of lane crests down the left edge, in place of the
   old sidebar (its rules left css/app.css). The handle collapses it to a hairline (body.rail-collapsed). At 800 px and below the rail
   starts collapsed and opens over the screen, so the screen keeps the full width. Loaded after lane-wheel.css. */
.shell{display:flex;align-items:flex-start;min-height:calc(100vh - var(--hud-hdr,54px))}
.main{flex:1;min-width:0}
.content.wide{max-width:none;padding:0}

.crest-rail{--rail-w:56px;position:sticky;top:var(--hud-hdr,54px);z-index:40;flex:none;align-self:stretch;width:var(--rail-w);
  height:calc(100vh - var(--hud-hdr,54px));background:var(--surface);border-right:1px solid var(--border);transition:width .15s ease-out}
body.rail-collapsed .crest-rail{width:3px;background:var(--border)}
.crest-list{list-style:none;margin:0;padding:34px 0 12px;height:100%;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;
  align-items:center;gap:8px;scrollbar-width:thin}
.crest-list li{display:flex}

/* a crest: a small shield in the lane's colour (--crest, set from laneModel.laneColor), with two letters */
.crest{--crest:var(--accent);position:relative;width:38px;height:42px;padding:0;border:0;background:none;cursor:pointer;color:var(--text)}
.crest::before{content:'';position:absolute;inset:0;background:var(--crest);opacity:.22;
  clip-path:polygon(50% 0,100% 14%,100% 58%,50% 100%,0 58%,0 14%);transition:opacity .12s}
.crest::after{content:'';position:absolute;inset:2px;border:0;background:var(--surface);
  clip-path:polygon(50% 0,100% 14%,100% 58%,50% 100%,0 58%,0 14%);z-index:0}
.crest-glyph{position:relative;z-index:1;display:block;font:600 12px/1 'Chakra Petch',system-ui,sans-serif;letter-spacing:.5px;
  color:var(--crest);margin-top:-4px}
.crest:hover::before,.crest[aria-current="true"]::before{opacity:1}
.crest[aria-current="true"] .crest-glyph{color:var(--text)}
.crest:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
/* the lane's focus state, from the old sidebar badge: parked or paused dims the crest, no goal yet leaves it plain */
.crest[data-lane="parked"],.crest[data-lane="paused"]{opacity:.6}

/* the handle: a small tab at the rail's top edge, still there when the rail is a hairline */
.crest-handle{position:absolute;top:6px;left:50%;transform:translateX(-50%);z-index:2;width:26px;height:22px;padding:0;
  display:flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:6px;background:var(--surface2);
  color:var(--text-muted);cursor:pointer}
.crest-handle:hover{color:var(--text);border-color:var(--accent)}
.crest-handle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.crest-chev::before{content:'\2039';font-size:16px;line-height:1}
body.rail-collapsed .crest-handle{left:0;transform:none;border-radius:0 6px 6px 0;width:18px;height:34px}
body.rail-collapsed .crest-chev::before{content:'\203A'}

/* a narrow screen: the rail opens over the screen and the screen keeps the full width */
@media (max-width:800px){
  .shell{display:block}
  .crest-rail{position:fixed;left:0;top:var(--hud-hdr,54px);bottom:0;height:auto;z-index:90;box-shadow:0 10px 40px rgba(0,0,0,.5)}
  body.rail-collapsed .crest-rail{width:0;border-right:0;box-shadow:none}
}

@media (prefers-reduced-motion:reduce){.crest-rail,.crest::before{transition:none}}
