/* ===== Left sidebar for signed-in customers, modelled on the PayPal Developer Dashboard =====
   PayOut logo + collapse chevron, the features, help and resources, and the PayOut line at the foot.
   Row height comes from the window height, so all rows fit evenly at any zoom level (no squeezing, no overlap);
   only a very short window scrolls the list. Wide screens: drag the right edge to resize (snaps to an icon rail
   when narrow), or use the « chevron / ☰. Narrower screens: a drawer over the page. */
:root {
  --side-full: 248px; --side-mini: 76px; --side: var(--side-full);
  /* top bar 72 + two dividers + list padding + foot ≈ 210px; the rest is shared by the 9 rows */
  --side-row: clamp(36px, calc((100vh - 210px) / 9), 54px);
}
body.side-mini { --side: var(--side-mini); }
.side { display: none; }
body.signed-in .side:not([hidden]) {
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: var(--side);
  background: #F7F8FC; border-right: 1px solid var(--hair);
  transition: width 220ms var(--ease, ease), transform 220ms var(--ease, ease);
}
body.side-dragging .side, body.side-dragging :is(.geo, .hdr, .shell, .ftr) { transition: none !important; }
body.side-dragging { cursor: col-resize; user-select: none; -webkit-user-select: none; }

/* top: logo + chevron on the sidebar's edge */
.side-top { position: relative; flex: none; height: var(--top); display: flex; align-items: center; justify-content: center; padding: 0 22px; }
.side-brand { display: flex; align-items: center; min-width: 0; text-decoration: none; }
.side-brand img { display: block; width: auto; max-width: 100%; }
.side-brand .full { height: 34px; }
.side-brand .mark { height: 30px; display: none; }
/* the lists scroll together only if the window is too short for every row; on tall windows the spare space is
   split evenly above Verify and below Help (auto margins drop to 0 when space is short, so nothing gets cut off) */
.side-scroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; padding: 4px 0 8px; }
.side-scroll > #nav { margin-top: auto; }
.side-scroll > .side-more { margin-bottom: auto; }
.side .nav { display: flex; flex-direction: column; align-items: stretch; gap: 2px; height: auto; padding: 0 10px;
  position: static; background: none; border: 0; box-shadow: none; }
.side .nav > a, .side .nav > button { position: relative; flex: none; display: flex; align-items: center; gap: 12px; height: var(--side-row); padding: 0 14px;
  border: 0; border-radius: 12px; background: none; width: 100%; text-align: left; cursor: pointer;
  font: 600 clamp(14px, calc(var(--side-row) * .3), 15px)/1.2 var(--sans); color: var(--ink); text-decoration: none; transition: background var(--t-btn), color var(--t-btn); }
.side .nav svg { width: 20px; height: 20px; stroke-width: 1.8; color: var(--ink-2); flex: none; }
.side .nav span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .nav .ext { flex: none; font-style: normal; font-size: 13px; color: var(--muted); }
.side .nav > a:hover, .side .nav > button:hover { background: #E9EEF8; color: var(--ink); }
.side .nav a[aria-current=page] { background: #C9DDFB; color: var(--navy-2); }
.side .nav a[aria-current=page] svg { color: var(--navy-2); }
.side .nav a[aria-current=page]::after { content: none; }
.side .nav > a:focus-visible, .side .nav > button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.side .nav .n { flex: none; margin: 0; }
.side-sep { flex: none; width: auto; margin: 7px 6px; border: 0; border-top: 1px solid var(--border); }

/* foot */
.side-foot { flex: none; margin: 0 10px 12px; padding: 12px 14px; border-top: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* drag handle: the sidebar's right edge */
.side-grip { position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; z-index: 2; cursor: col-resize; touch-action: none; }
.side-grip::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background var(--t-btn); }
.side-grip:hover::after, .side-grip:focus-visible::after, body.side-dragging .side-grip::after { background: var(--blue); }
.side-grip:focus-visible { outline: none; }

/* header: ☰ on the left like the dashboard; the header's own logo only shows when the sidebar doesn't */
body.signed-in .burger:not([hidden]) { display: grid; place-items: center; margin-left: -8px; color: var(--ink); }
body.signed-in .burger svg { width: 22px; height: 22px; }
body.signed-in .hdr-in { max-width: none; }

@media (min-width: 1101px) {
  body.signed-in .hdr .brand { display: none; }
  body.signed-in :is(.geo, .hdr, .shell, .ftr) { margin-left: var(--side); transition: margin-left 220ms var(--ease, ease); }
  /* icon rail */
  body.side-mini .side-top { padding: 0; }
  body.side-mini .side-brand .full { display: none; }
  body.side-mini .side-brand .mark { display: block; }
  body.side-mini .side .nav { padding: 0 12px; }
  body.side-mini .side .nav > a, body.side-mini .side .nav > button { justify-content: center; padding: 0; gap: 0; }
  body.side-mini .side .nav span, body.side-mini .side .nav .ext { display: none; }
  body.side-mini .side .nav .n { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; font-size: 10px; }
  body.side-mini .side-foot { display: none; }
}
@media (max-width: 1100px) {
  body.signed-in .side:not([hidden]) { width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; box-shadow: none;
    transition: transform 220ms var(--ease, ease), visibility 0s 220ms; }
  body.signed-in.side-open .side:not([hidden]) { transform: none; visibility: visible; box-shadow: 0 16px 48px rgba(0, 20, 53, .22); transition: transform 220ms var(--ease, ease); }
  .side-grip { display: none; }
  .side-dim:not([hidden]) { position: fixed; inset: 0; z-index: 55; background: rgba(0, 20, 53, .36); }
  body.side-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  body.signed-in .side, body.signed-in :is(.geo, .hdr, .shell, .ftr) { transition: none !important; }
}
