/* ═══════════════════════════════════════════════════════════════════════
   CIRCLE THRICE · R5 · THE RIGHT RAIL (CTRAIL) — styles. PROPOSED.
   Import AFTER ct-canon.css · ct-canon-r5.css · r4-22-pattern.css ·
   r5-library.css (the tray rows themselves are CT-LIB07).
   ═══════════════════════════════════════════════════════════════════════ */
.rl{position:relative;flex-shrink:0;width:386px;border-left:1px solid var(--vpale);background:var(--white);display:flex;flex-direction:column;min-height:0;transition:width .2s ease;}
.rl[data-open="false"]{width:46px;}
.rl-open{flex:1;min-height:0;display:flex;flex-direction:column;padding:8px 16px 10px;gap:11px;}
.rl[data-open="false"] .rl-open{display:none;}
/* the collapsed strip — the count badge only */
.rl-strip{display:none;flex-direction:column;align-items:center;gap:9px;width:100%;height:100%;padding:12px 0;border:none;background:none;cursor:pointer;color:var(--icon);}
.rl[data-open="false"] .rl-strip{display:flex;}
.rl-strip:hover{color:var(--blue);background:var(--paper);}
.rl-strip-ic svg{width:18px;height:18px;display:block;}
.rl-strip-n{font-family:var(--sc);font-size:10px;font-weight:700;letter-spacing:.02em;color:var(--white);background:var(--blue);border-radius:20px;padding:2px 7px;line-height:1.3;}
.rl-strip-t{font-family:var(--sc);font-size:8.5px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;writing-mode:vertical-rl;}
/* head — the Details ⇄ Library toggle + collapse */
.rl-hd{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;padding:3px 30px 5px;}
.rl-seg{display:inline-flex;border:1px solid var(--vpale);border-radius:20px;overflow:hidden;background:var(--white);box-shadow:0 1px 2px rgba(43,50,64,.06);}
.rl-seg b{font-family:var(--sc);font-size:8.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);padding:5px 13px;cursor:pointer;}
.rl-seg b:hover{color:var(--blue);}
.rl-seg b.on{background:var(--blue);color:var(--white);}
.rl-lbl{font-family:var(--sc);font-size:8.5px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);}
.rl-close{position:absolute;right:0;top:50%;transform:translateY(-50%);width:24px;height:24px;border:1px solid var(--vpale);border-radius:6px;background:var(--white);cursor:pointer;color:var(--icon);display:inline-flex;align-items:center;justify-content:center;}
.rl-close svg{width:12px;height:12px;transform:rotate(-90deg);}
.rl-close:hover{border-color:var(--l-blue);color:var(--blue);}
/* panes */
.rl-body{flex:1;min-height:0;display:flex;flex-direction:column;}
.rl-pane{display:none;flex:1;min-height:0;flex-direction:column;gap:18px;}
.rl[data-mode="details"] .rl-pane[data-pane="details"],
.rl[data-mode="library"] .rl-pane[data-pane="library"]{display:flex;}
.rl-sub{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted);}
.rl-sub b{font-family:var(--disp);font-weight:600;color:var(--ink);}
.rl-n{margin-left:auto;font-family:var(--sc);font-size:9px;font-weight:700;color:var(--blue);background:rgba(63,109,150,.1);border-radius:20px;padding:2px 8px;}
.rl-pills{display:flex;flex-wrap:wrap;gap:6px;}
.rlp{display:inline-flex;align-items:center;gap:4px;font-family:var(--sc);font-size:8.5px;font-weight:600;letter-spacing:.05em;color:var(--muted);background:var(--white);border:1px solid var(--vpale);border-radius:20px;padding:3px 9px;cursor:pointer;line-height:1;box-shadow:0 1px 2px rgba(43,50,64,.06);}
.rlp .pg{font-size:10px;color:var(--pl,var(--icon));}
.rlp:hover{border-color:var(--l-blue);color:var(--blue);}
.rlp.on{background:var(--pl,var(--blue));border-color:var(--pl,var(--blue));color:var(--white);}
.rlp.on .pg{color:var(--white);}
/* the Library list is the ONE scroll region on the surface — 13 relevant items
   cannot fit a 720px frame, and the rail is content, not a static diagram. */
.rl-list{flex:1;min-height:0;display:flex;flex-direction:column;gap:12px;overflow-y:auto;overscroll-behavior:contain;margin-top:2px;padding-right:5px;}
.rl-list::-webkit-scrollbar{width:6px;}
.rl-list::-webkit-scrollbar-track{background:transparent;}
.rl-list::-webkit-scrollbar-thumb{background:var(--vpale);border-radius:3px;}
.rl-list:hover::-webkit-scrollbar-thumb{background:var(--rule);}
.rl-note{font-size:10px;line-height:1.5;color:var(--icon);border-top:1px solid var(--vpale);padding-top:7px;}
.rl-note b{color:var(--muted);font-weight:600;}
/* inside the rail the key tray OVERLAYS the pane instead of pushing the tables
   down — the pane is a non-scrolling column, so a 90px body in flow clipped the
   aspect table on the Day surface no matter what the persisted open state was. */
.rl .okt{position:relative;flex:0 0 auto;z-index:6;overflow:visible;margin-bottom:14px;}
.rl .okt-body{position:absolute;left:0;right:0;top:100%;background:var(--white);border:1px solid var(--vpale);border-top:none;border-radius:0 0 9px 9px;box-shadow:0 12px 26px rgba(43,50,64,.09);}
.rl .okt[data-open="true"] .okt-body{max-height:280px;}
.rl .okt-inner{border-top:none;}
/* the tray rows: more air inside each card, and a lighter lift */
.rl .tstat{padding:13px 14px;gap:12px;box-shadow:0 1px 2px rgba(43,50,64,.045),0 2px 6px rgba(43,50,64,.035);}
.rl .tstat-why{font-size:10.5px;margin-top:4px;}
.rl .tstat-tags{margin-top:9px;}
.rl .tstat-nm{margin-top:3px;}
/* Overview: content + rail share the surface below the chrome */
.ov-split{flex:1;min-height:0;display:flex;}
.ov-split>.dp-scroll{flex:1;min-width:0;}
/* the page padding was sized for the full 1200px surface — with the rail open it
   eats 11% of what's left, so contract it and let the reading column re-centre
   in the remaining space. Closed rail (46px) gets the original margins back. */
.ov-split:has(.rl[data-open="true"])>.dp-scroll{padding-left:24px;padding-right:24px;}
/* optical centring: the day card's first 96px is the anchor gutter (times, glyphs,
   often empty), which made a block-centred card read as right-shifted. With the rail
   open, narrow that gutter — the labels only need ~56px — so the reading measure moves
   left and gains the freed width instead of being squeezed. */
/* NOTE: the rule below moves with the gutter (see the .mg::before override above). */
/* ONE geometry per page: every row narrows to the 56px gutter, and the Margin's
   absolutely-positioned timeline rule + dots move with it (56 gutter + 30 gap = 86),
   which also returns 40px of measure to the transit prose. */
.ov-split:has(.rl[data-open="true"]) .dp-col .rg-row,
.ov-split:has(.rl[data-open="true"]) .dp-col .mg-row{grid-template-columns:56px minmax(0,1fr);}
.ov-split:has(.rl[data-open="true"]) .dp-col .mg::before{left:86px;}
.ov-split:has(.rl[data-open="true"]) .dp-col .dn-node{left:86px;}
.ov-split:has(.rl[data-open="true"]) .dp-col>.onv{padding-left:0;padding-right:56px;}
/* expanded sections: when a row's anchor cell is EMPTY it was still reserving the
   56px gutter, indenting the reading block 86px past the section title above it.
   Collapse the gutter in that case so prose left-aligns with its own heading. */
.ov-split .dp-caltray .viz-body .rg-row:has(>.sn-anchor:empty){grid-template-columns:0 minmax(0,1fr);column-gap:0;}
.ov-split>.dp-scroll>.dp-col{margin-left:auto;margin-right:auto;}
