
.rp { display:grid; grid-template-columns:minmax(150px, 1fr) 4fr; flex:1 1 auto; min-height:0; }

.rp-rail { display:flex; flex-direction:column; padding:var(--s3) 0; overscroll-behavior:contain;
           border-right:1px solid var(--line); background:var(--bg0); overflow-y:auto; }
.rp-tabs { display:flex; flex-direction:column; gap:1px; }

.rp-group { padding:var(--s3) var(--s4) var(--s1); color:var(--faint); }
.rp-group:first-child { padding-top:0; }

.rp-out { margin-top:auto; background:none; border:0; border-top:1px solid var(--line);
          border-left:2px solid transparent; cursor:pointer; padding:var(--s3) var(--s4) var(--s2);
          text-align:left; color:var(--muted); font:600 var(--fs-ui) var(--ui);
          transition:color var(--t-fast); }
.rp-out:hover { color:var(--red); }
.rp-out:focus-visible { outline:2px solid var(--red); outline-offset:-2px; }

.rp-tab { background:none; border:0; border-left:2px solid transparent; cursor:pointer;
          padding:var(--s2) var(--s4); text-align:left; color:var(--muted);
          font:600 var(--fs-ui) var(--ui); transition:color var(--t-fast); }
.rp-tab:hover:not([disabled]) { color:var(--text); }

.rp-tab[disabled] { opacity:.4; cursor:not-allowed; }
.rp-tab[aria-selected=true] { color:var(--text); border-left-color:var(--acc);
                              background:var(--bg2); }
.rp-tab:focus-visible { outline:2px solid var(--acc); outline-offset:-2px; }
@media (pointer:coarse) { .rp-tab, .rp-out { min-height:44px; } }
.rp-pane { display:flex; flex-direction:column; padding:var(--s4) var(--s4) 0; overflow:auto;
           overscroll-behavior:contain; scrollbar-gutter:stable; font:var(--fs-ui)/1.5 var(--ui); }

.rp-pane > section { flex:none; min-width:0; padding-bottom:var(--s4); }

.rp-subs { display:flex; border-bottom:1px solid var(--line); overflow-x:auto;
           overscroll-behavior-x:contain; scrollbar-width:none; }
.rp-sub { flex:none; background:none; border:0; border-bottom:2px solid transparent;
          margin-bottom:-1px; min-height:40px; padding:0 var(--s4); cursor:pointer;
          font:600 var(--fs-ui)/1 var(--ui); color:var(--muted); white-space:nowrap;
          transition:color var(--t-fast), border-color var(--t-fast); }
.rp-sub:hover { color:var(--text); }
.rp-sub[aria-selected=true] { color:var(--text); border-bottom-color:var(--acc); }
.rp-sub:focus-visible { outline:2px solid var(--acc); outline-offset:-2px; }

.rp-pane > section.fit, .fit > .fit { flex:1 0 auto; display:flex; flex-direction:column; }

.fit > .fill { flex:1 1 0px; min-height:160px; min-width:0; }

.fill:has(> .panel) { display:flex; flex-direction:column; }
.fill > .panel { display:flex; flex-direction:column; min-height:0; min-width:0; }
.fill > .panel > .tablewrap { flex:1 1 auto; min-height:0; overflow:auto; }

.win { display:flex; flex-direction:column; min-height:0; padding:var(--s3);
       background:var(--bg2); border:1px solid var(--line); }
.win-h { flex:none; margin-bottom:var(--s2); }
.win-b { flex:1 1 auto; min-height:0; overflow:auto; }


.overlay .box.rp-sheet { display:flex; flex-direction:column;
                         height:640px; max-height:min(86dvh, 100%); overflow:hidden; }
.rp-sheet > .panel-h { flex:none; }

.rp-sheet * { scrollbar-color:var(--acc) transparent; }
.rp-sheet ::-webkit-scrollbar-thumb { background:var(--acc); border:0; }   


.rp-page { display:flex; flex-direction:column; min-height:0; }
.rp-page > .rp { grid-template-columns:minmax(160px, 220px) minmax(0, 1fr); }
.rp-page .rp-pane { scrollbar-gutter:stable both-edges; background:var(--bg1);
                    padding:var(--s5) var(--s5) 0; }
.rp-page .rp-pane > section { width:min(1100px, 100%); margin-inline:auto; }

@media (max-width:720px) {
  
  .rp { grid-template-columns:1fr; }
  .rp-rail, .rp-tabs { flex-direction:row; }
  .rp-rail { overflow-x:auto; padding:0; border-right:0; border-bottom:1px solid var(--line); }
  .rp-out { margin:0 0 0 auto; border-top:0; border-left:1px solid var(--line);
            padding:var(--s2) var(--s4); white-space:nowrap; }
  .rp-tab { border-left:0; border-bottom:2px solid transparent; white-space:nowrap; }
  .rp-tab[aria-selected=true] { border-left-color:transparent; border-bottom-color:var(--acc); }
  
  .fit > .fill { flex:none; min-height:0; }
  .win-b { overflow:visible; }
  
  .overlay .box.rp-sheet { display:block; height:auto; max-height:none; overflow:visible; }
  .rp-sheet .rp-pane { overflow:visible; scrollbar-gutter:auto; }
  .rp-group { display:none; }
  
  .rp-page > .rp { grid-template-columns:1fr; grid-template-rows:auto minmax(0, 1fr); }
  .rp-page .rp-pane { padding:var(--s4) var(--s3) 0; }
}
