/* The translucent rail sits over a separate wash so its glass has colour to pick up. */
.nb {
  --nb-bg: #fbf5f7;
  --rail-width: clamp(280px, 22vw, 320px);
  --rail-text: #334b53;
  --rail-quiet: #586d76;
  --rail-rule: rgba(87, 114, 127, .21);
  isolation: isolate;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
}
.nb::before {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  inset: 0 auto 0 0;
  width: calc(var(--rail-width) + 26px);
  background: radial-gradient(ellipse at 2% 12%, #ecc6d2 0%, transparent 62%),
              radial-gradient(ellipse at 18% 87%, #adcfe4 0%, transparent 55%),
              linear-gradient(90deg, #f4e1e8, transparent);
}
.nb-side {
  top: 12px;
  height: calc(100dvh - 24px);
  margin: 12px 0 12px 12px;
  overflow: hidden;
  color: var(--rail-text);
  background: #f7e9ee;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 7px 28px rgba(63,81,90,.10);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nb-side {
    background: linear-gradient(150deg,rgba(255,240,245,.49),rgba(255,250,251,.52) 53%,rgba(231,244,255,.47));
    -webkit-backdrop-filter: blur(23px) saturate(118%);
    backdrop-filter: blur(23px) saturate(118%);
  }
}
.nb-brand {
  position: relative;
  flex: none;
  min-height: 113px;
  padding: 19px 23px;
  gap: 8px;
  background: transparent;
  border: 0;
}
.nb-brand::after, .nb-user::before {
  content: "";
  position: absolute;
  left: 19px; right: 19px;
  height: 1px;
  background: var(--rail-rule);
  box-shadow: 0 1px rgba(255,255,255,.6);
}
.nb-brand::after { bottom: 0; }
.nb-brand > div { display: grid; gap: 8px; }
.nb-brand strong { color: #354950; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: .1em; }
.nb-brand small { display:flex; align-items:center; gap:7px; font:600 10px/1 system-ui,sans-serif; letter-spacing:.24em; color:#5d6c70; }
.nb-brand small::before { content:""; width:17px; height:1px; background:#a77961; }
.nb-nav { padding: 21px 12px 16px; scrollbar-width: thin; scrollbar-color: #bcc9ca transparent; }
.nb-nav-title { margin:0 5px 11px 9px; color:var(--rail-quiet); font-size:13px; font-weight:650; letter-spacing:.08em; }
.nb .nb-nav-title .nb-icon-btn {
  width:29px; height:29px; padding:6px;
  border:1px solid #a9babd88; border-radius:9px; color:#49636a; background:#ffffff75;
}
.nb-nav-title .ni { width:15px; height:15px; }
.nb-branch { margin: 4px 0; }
.nb-branch-row { position:relative; border-radius:10px; padding:0 4px; gap:0; }
.nb-branch-row:hover, .nb-branch-row:focus-within { background:rgba(255,255,255,.54); }
.nb .nb-branch-leading .nb-branch-toggle {
  min-height:40px; font-size:14px; font-weight:600; color:var(--rail-text);
}
.nb-branch-leading, .nb .nb-branch-leading .nb-branch-toggle { grid-template-columns:15px 31px minmax(0,1fr); }
.nb-chevron {color:var(--rail-quiet);}
.nb-chevron .ni {width:12px;height:12px;}
.nb .nb-branch-leading > .nb-emoji-trigger { width:29px; height:29px; min-height:29px; font-size:17px; border-radius:8px; background:#f9fcfc90; color:#526c74; box-shadow:inset 0 0 0 1px #809ba433; }
.nb .nb-branch-row.active {
  color:#694a89; background:#f0e8fa; box-shadow:inset 0 0 0 1px #d9c7eb;
}
.nb .nb-branch-row.active .nb-branch-toggle,
.nb-branch-row.active .nb-chevron,
.nb-branch-row.active .nb-branch-total { color:inherit; }
.nb .nb-branch-row.active .nb-emoji-trigger {
  color:#694a89; background:#e8dcf5; box-shadow:inset 0 0 0 1px #cdb7e3;
}
.nb .nb-tree-action {width:24px; height:30px; padding:3px; color:var(--rail-quiet);}
.nb .nb-tree-action:hover, .nb .nb-tree-action[aria-expanded="true"] {color:#783e50; background:#fffaf7;}
.nb .nb-order-grip {color:var(--rail-quiet);}
.nb-branch-total { display:none; }
.nb-children { padding-left:10px; margin:1px 0 8px 23px; border-left:1px solid #92aab45c; }
.nb-tree-item { position:relative; margin:3px 0; padding:0 4px; border:1px solid transparent; border-radius:8px; }
.nb .nb-tree-item .nb-tree-note { min-height:33px; padding:4px 3px; color:var(--rail-text); font-size:14px; }
.nb .nb-tree-item .nb-emoji-trigger { width:24px; height:26px; min-height:26px; font-size:17px; color:var(--rail-quiet); }
.nb-tree-item:hover { background:rgba(255,255,255,.52); }
.nb .nb-tree-item .nb-tree-note:hover {background:transparent;}
.nb-tree-item:has(.nb-tree-note[aria-current="page"]) {
  background: linear-gradient(110deg,#fff8f7ed,#f5e4e5db); border-color:#d4adb76e;
  box-shadow:0 2px 5px #7c464f0b,inset 0 1px #ffffff;
}
.nb-tree-item:has(.nb-tree-note[aria-current="page"])::before {
  content:""; pointer-events:none; position:absolute; left:-12px; top:50%;
  width:4px; height:12px; margin-top:-6px; background:#a35c6e; border-radius:3px;
}
.nb .nb-tree-item .nb-tree-note[aria-current="page"], .nb .nb-tree-item:has(.nb-tree-note[aria-current="page"]) .nb-emoji-trigger { color:#813e51; }
.nb-branch-menu { top:39px; right:4px; border:1px solid #c9d1cf; border-radius:11px; background:#fffcf7; box-shadow:0 6px 20px #304b5224; }
.nb-user { position:relative; background:rgba(255,255,255,.21); padding:15px 18px; border:0; color:var(--rail-text); }
.nb-user::before {top:0;}
.nb-avatar { width:33px;height:33px;border-radius:12px;background:#fff9f5;color:#844b5a;border:1px solid #c7abae8f;font-size:14px; }
.nb-user-name {font-size:14px;}
.nb-side .nb-icon-btn:focus-visible, .nb-side .nb-emoji-trigger:focus-visible {outline-offset:0;}
@media (hover:hover) and (pointer:fine) {
  .nb-branch-total {
    position:absolute; right:9px; top:50%; transform:translateY(-50%); display:block;
    min-width:21px; text-align:center; pointer-events:none; color:var(--rail-quiet); font:500 12px/1.7 system-ui,sans-serif; font-variant-numeric:tabular-nums;
  }
  .nb-branch-row .nb-tree-action, .nb .nb-branch-row > .nb-order-grip, .nb .nb-tree-item > .nb-order-grip {opacity:0;}
  .nb-branch-row:is(:hover,:focus-within,:has([aria-expanded="true"].nb-tree-more)) .nb-branch-total { opacity:0; }
  .nb-branch-row:is(:hover,:focus-within,:has([aria-expanded="true"].nb-tree-more)) .nb-tree-action,
  .nb .nb-branch-row:is(:hover,:focus-within) > .nb-order-grip,
  .nb .nb-tree-item:is(:hover,:focus-within) > .nb-order-grip {opacity:1;}
}
.nb .nb-side .nb-drop-before {box-shadow:inset 0 3px #97536a;}
.nb .nb-side .nb-drop-after {box-shadow:inset 0 -3px #97536a;}
@media(max-width:820px) {
  .nb {grid-template-columns:minmax(0,1fr);}
  .nb::before {display:none;}
  .nb-side {inset:8px auto 8px 8px; top:8px; width:min(325px,calc(100vw - 25px)); height:calc(100dvh - 16px); margin:0; border-radius:17px; background-color:#f6e1e8e8;}
  .nb-brand {min-height:90px; padding:14px 18px;}
  .nb-brand .nb-close-nav {margin-left:auto; color:var(--rail-quiet);}
  .nb.nav-open .nb-scrim {background:rgba(41,59,65,.26);}
  .nb .nb-branch-leading .nb-branch-toggle, .nb .nb-tree-item .nb-tree-note {min-height:42px;}
  .nb .nb-tree-action {width:30px; height:38px;}
  .nb-nav {padding-top:16px;}
  .nb-branch-menu {top:41px;}
}
@media (prefers-reduced-transparency:reduce) {
  .nb-side {background:#f6edf1; backdrop-filter:none; -webkit-backdrop-filter:none;}
}
