/* ════════════════════════════════════════════════════════════════════════════
   39-sidenav.css — the sidebar, v2 (2026-09-28).
   Markup: templates/app.html (brand, top rows, Watchlist, footer) +
   templates/_sidenav.html (tool groups) + _sidenav_macros.html (Lucide icons).
   Behaviour: static/js/sidenav.js (window.MPSideNav).

   THE LOOK follows two references the owner picked, reimplemented here in
   plain CSS on tokens.css (no framework):
     21st.dev @arunjdass "dashboard-sidebar"      rows, groups, hover/active
     21st.dev @arihantcodes "sidebar-navbar"      the icon-only rail
   From the first: rows inset from the panel edge, 16px icons at a light
   stroke, 13px labels, a soft rounded pill for hover and a stronger one for
   the selected row (no accent bar), small uppercase group headings, and the
   account + settings pinned to the bottom behind a hairline. From the second:
   the collapsed rail is a single centred column of icon buttons.

   APPENDED LAST and owns the .snv- namespace (no other file uses it). It also
   restyles, inside .sidebar only, three older families that now sit in the
   same row grammar: .stock-item (the watchlist rows app.js builds),
   .account-chip (the profile) and .sidebar-toggle. Each override below says
   which 02 / 03 rule it beats and on what specificity. Nothing in 02 or 03 is
   edited.

   THE RAIL CONTRACT is unchanged: everything is laid out at --sidebar-w and
   .sidebar-clip clips it to --rail-w; nothing here animates a width. Row
   backgrounds are drawn by ::before so that in the rail the pill can become a
   square centred on the rail instead of a band cut off by the clip.
   ════════════════════════════════════════════════════════════════════════════ */

.sidebar{
  --snv-in:0.5rem;        /* row inset from the panel edge                  */
  --snv-px:0.625rem;      /* row inner padding                              */
  --snv-h:2.5rem;         /* row height, the SAME in the open panel and the rail (2026-11-10 one size: 2.25rem open / 2.75rem rail before) */
  --snv-r:0.375rem;       /* pill radius                                    */
  /* icon column: left edge = in + px, 16px wide (the glyphs are a fixed
     16px, NOT 1rem: the root font is fluid, and a 1rem half-width here put
     every 16px glyph ~1px right of its rail square). The rail shifts the
     column onto the rail's centre line with this one transform. */
  --snv-ico:20px;         /* ONE glyph size in both states (Ali 2026-11-10 "one professional size": 18px open / 28px rail before).
                             Linear, Notion, Vercel: the icon never scales on collapse; only the labels go and the bar narrows. */
  --snv-rail-scale:1;     /* the rail no longer scales its glyphs (kept as a variable so the transform rule stays one place) */
  --snv-rail-shift:calc(var(--rail-w) / 2 - var(--snv-in) - var(--snv-px) - var(--snv-ico) / 2);
  /* Child rows sit one step in from their section heading, like the
     reference's nested items (paddingLeft level * 12 + 10). */
  --snv-indent:0.75rem;
  --snv-hover:color-mix(in srgb, var(--text-primary) 5%, transparent);
  --snv-sel:color-mix(in srgb, var(--text-primary) 9%, transparent);
  /* Resting inks (2026-09-29, owner: "really hard to see"). The panel used
     --text-secondary for labels and --text-muted for glyphs and secondary
     text; at 13px beside a thin stroked glyph that read as faint, and muted
     sits under AA in light (3.6:1). Three steps, mixed from tokens.css and
     scoped to the sidebar (the rail flyout lives inside it):
       --snv-ink        labels, section headings, tickers   11 to 13:1
       --snv-ink-icon   resting glyphs                      7 to 8.6:1
       --snv-ink-quiet  names, email, chevrons, hints       5.3 to 6.8:1
     Hover and selected stay a step above at --text-primary. */
  --snv-ink:color-mix(in srgb, var(--text-primary) 70%, var(--text-secondary));
  --snv-ink-icon:var(--text-secondary);
  --snv-ink-quiet:color-mix(in srgb, var(--text-secondary) 60%, var(--text-muted));
  /* Section headings (v7, owner 2026-10-04: "make the header sections a
     little more bolder"). Headings read a step above their pages: full
     primary ink at semibold, over pages at --snv-ink and regular weight. */
  --snv-ink-head:var(--text-primary);
  --snv-head-gap:0.5rem;  /* space after an open section, before the next */
}
/* A flat panel, like the reference, instead of the old top-to-bottom wash. */
.sidebar .sidebar-clip{background:var(--bg-primary);}

/* ── Top block: Search tools + the ungrouped rows + Pinned ──────────────── */
.snv-top{
  display:flex;flex-direction:column;
  width:var(--sidebar-w);flex-shrink:0;
  padding:0.5rem 0 0.25rem;
}
.snv-search{
  position:relative;display:flex;align-items:center;
  width:var(--sidebar-w);height:var(--snv-h);margin-bottom:0.25rem;
}
.snv-search-btn{
  position:absolute;left:0;top:0;bottom:0;z-index:1;
  display:flex;align-items:center;
  width:calc(var(--snv-in) + var(--snv-px) + 1rem);padding:0 0 0 calc(var(--snv-in) + var(--snv-px));
  border:0;background:transparent;color:var(--snv-ink-icon);cursor:pointer;
  pointer-events:none;              /* the input under it takes the click */
}
.snv-input{
  flex:1 1 auto;min-width:0;height:var(--snv-h);
  margin:0 var(--snv-in);
  padding:0 1.75rem 0 calc(var(--snv-px) + 1rem + var(--snv-px));
  border:0;border-radius:var(--snv-r);
  background:var(--snv-hover);
  box-shadow:inset 0 0 0 1px var(--border-subtle);
  color:var(--text-primary);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:400;
  outline:none;
  transition:box-shadow .12s var(--ease-out), background .12s var(--ease-out), opacity var(--sb-toggle);
}
.snv-input::placeholder{color:var(--snv-ink-quiet);opacity:1;}
.snv-input:hover{box-shadow:inset 0 0 0 1px var(--border-default);}
.snv-input:focus{background:var(--snv-sel);box-shadow:inset 0 0 0 1px var(--accent);}
.snv-kbd{
  position:absolute;right:calc(var(--snv-in) + 0.4375rem);top:50%;transform:translateY(-50%);
  min-width:1.125rem;height:1.125rem;padding:0 0.25rem;box-sizing:border-box;
  display:flex;align-items:center;justify-content:center;
  border-radius:0.25rem;box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--snv-ink-quiet);background:var(--bg-primary);
  font-family:var(--font-mono);font-size:max(0.625rem, var(--fs-floor));line-height:1;
  pointer-events:none;transition:opacity .12s var(--ease-out);
}
.snv-input:focus ~ .snv-kbd,
.snv-input:not(:placeholder-shown) ~ .snv-kbd{opacity:0;}
.snv-empty{
  width:var(--sidebar-w);box-sizing:border-box;
  padding:0.25rem calc(var(--snv-in) + var(--snv-px)) 0.5rem;
  color:var(--snv-ink-quiet);font-size:max(0.75rem, var(--fs-floor));
}
.snv-empty[hidden]{display:none;}

/* ── Groups ─────────────────────────────────────────────────────────────── */
.snv-group[hidden]{display:none;}
/* Sections are rows in one list, 2px apart, like the reference's
   collapsible items (flex-col gap-0.5); the indent, not a gap, tells one
   section's pages from the next heading. */
.snv-group{margin-top:0.125rem;}
.snv-top .snv-group{margin-top:0;}
.snv-top .snv-pinned{margin-top:0.125rem;}
.wl-scroll > .snv-group:first-child{margin-top:0.375rem;}
/* Ticket 5 fixes (2026-10-20): the top rows (Ask, Workspaces, All tools)
   and Pinned open the scroll well, so they scroll with every other row;
   Search alone stays fixed above it. They keep the top block's spacing. */
.sidebar .wl-scroll > #snv-g-top{margin-top:0;}
.sidebar .wl-scroll > #snv-g-pinned{margin-top:0.125rem;}
/* The Workspaces chevron is inside the well now, so the gutter offset app.js
   measures for a chevron outside it would count the scrollbar twice. */
.sidebar .wl-scroll #wks-chevron{--wks-gutter:0px;}
.wl-scroll{padding-bottom:0.75rem;}
/* The reference hides the well's scrollbar; ours only shows while the
   pointer is over the list, so it never eats the rows' right edge at rest. */
.sidebar .wl-scroll{scrollbar-width:thin;scrollbar-color:transparent transparent;}
.sidebar .wl-scroll:hover{scrollbar-color:var(--border-default) transparent;}
/* v5 (owner 2026-09-29): no scrollbar while a section folds or opens
   (sidenav.js sets .snv-folding for the length of it), and a stable gutter
   so the rows never change width when the well starts or stops scrolling. */
.sidebar .wl-scroll{scrollbar-gutter:stable;}
.sidebar .wl-scroll.snv-folding,
.sidebar .wl-scroll.snv-folding:hover{scrollbar-color:transparent transparent;}
/* T9 fix B (2026-10-24): an overflowing well says so. While rows sit past
   an edge (sidenav.js snv-more-up / snv-more-down) that edge fades out
   over 2rem (a mask: no line, no stripe) and the slim thumb shows at rest
   in the quiet stone ink, a step stronger on hover. The fold rule above
   still hides it while a section opens or closes. */
.sidebar .wl-scroll.snv-more-up:not(.snv-folding),
.sidebar .wl-scroll.snv-more-down:not(.snv-folding){scrollbar-color:var(--border-default) transparent;}
.sidebar .wl-scroll.snv-more-up:not(.snv-folding):hover,
.sidebar .wl-scroll.snv-more-down:not(.snv-folding):hover{scrollbar-color:var(--border-strong) transparent;}
/* T9 fix c (2026-10-24): the 2rem fade read as no fade at all (a reviewer
   saw none at 1280 in either theme): the edge now fades over 3.5rem, more
   than a whole row, down to a faint trace, so the next row visibly dims
   into the edge whenever more items sit past it. */
.sidebar .wl-scroll{--snv-fade:3.5rem;}
.sidebar .wl-scroll.snv-more-down{
  -webkit-mask-image:linear-gradient(to bottom, #000 calc(100% - var(--snv-fade)), rgb(0 0 0 / 0.08));
  mask-image:linear-gradient(to bottom, #000 calc(100% - var(--snv-fade)), rgb(0 0 0 / 0.08));
}
.sidebar .wl-scroll.snv-more-up{
  -webkit-mask-image:linear-gradient(to bottom, rgb(0 0 0 / 0.08), #000 var(--snv-fade));
  mask-image:linear-gradient(to bottom, rgb(0 0 0 / 0.08), #000 var(--snv-fade));
}
.sidebar .wl-scroll.snv-more-up.snv-more-down{
  -webkit-mask-image:linear-gradient(to bottom, rgb(0 0 0 / 0.08), #000 var(--snv-fade), #000 calc(100% - var(--snv-fade)), rgb(0 0 0 / 0.08));
  mask-image:linear-gradient(to bottom, rgb(0 0 0 / 0.08), #000 var(--snv-fade), #000 calc(100% - var(--snv-fade)), rgb(0 0 0 / 0.08));
}

.snv-head{
  /* A section heading is a ROW (the reference's collapsible item: 16px
     glyph, 13px label, a chevron on the right, the same hover pill as a
     page row); its pages sit one indent step in. v7 (2026-10-04): the
     heading is SEMIBOLD in full primary ink, so a section reads apart from
     its pages at a glance (same size, no caps, no rule or stripe). */
  position:relative;isolation:isolate;
  display:flex;align-items:center;gap:var(--snv-px);
  width:var(--sidebar-w);height:var(--snv-h);margin:0;
  padding:0 calc(var(--snv-in) + var(--snv-px));box-sizing:border-box;
  border:0;border-radius:0;background:transparent;
  color:var(--snv-ink-head);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:600;
  letter-spacing:0.01em;text-transform:none;text-align:left;
  cursor:pointer;
  transition:color .12s var(--ease-out);
}
.snv-head-text{
  flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  opacity:0;transform:translateX(-0.375rem);
  transition:opacity var(--sb-toggle), transform var(--sb-toggle);
}
.snv-head:hover{color:var(--text-primary);}
.snv-head:focus-visible{outline:none;color:var(--text-primary);}
/* The reference's chevron: always shown, quiet, pointing down while the
   section is open and right while it is folded. */
.snv-chev{
  flex:0 0 auto;width:14px;height:14px;
  color:var(--snv-ink-quiet);
  transition:transform .2s var(--ease-out), opacity .12s var(--ease-out), color .12s var(--ease-out);
}
.snv-head:hover .snv-chev,.snv-head:focus-visible .snv-chev{color:var(--text-secondary);}
.snv-shut > .snv-head .snv-chev,
.snv-wl > .snv-head[aria-expanded="false"] .snv-chev{transform:rotate(-90deg);}

/* Fold: height 0 <-> auto (interpolate-size where supported, else a snap).
   visibility keeps a folded group's rows out of the tab order. */
.snv-body{
  position:relative;
  display:flex;flex-direction:column;gap:0.125rem;
  width:100%;
  interpolate-size:allow-keywords;
  height:auto;overflow:hidden;
  transition:height .2s var(--ease-out), opacity .16s var(--ease-out), visibility 0s linear 0s;
}
.snv-shut > .snv-body{
  height:0;opacity:0;visibility:hidden;
  transition:height .2s var(--ease-out), opacity .12s var(--ease-out), visibility 0s linear .2s;
}
.wl-scroll .snv-group,.wl-scroll .snv-head,.wl-scroll .snv-row{width:100%;}
/* A section's body opens 2px under its heading (the reference's mt-0.5). */
.snv-group:not(.snv-plain) > .snv-body{padding-top:0.125rem;box-sizing:border-box;}
.snv-shut > .snv-body,
.snv-wl > #wl-body.collapsed,
:root.wl-shut .snv-wl > #wl-body{padding-top:0;}

/* ── Nesting: pages one step in from their section ─────────────────────── */
/* Open panel only: the rail keeps every glyph on one centre line. The row
   and its hover pill stay full width (as in the reference); only the glyph
   and the label move in. */
:root.sb-open .sidebar .snv-group:not(.snv-plain) > .snv-body .snv-row > .snv-item,
:root.sb-open .sidebar .snv-wl .stock-list .stock-item{
  padding-left:calc(var(--snv-in) + var(--snv-px) + var(--snv-indent));
}
/* No vertical guide line under an open section (owner, v4 2026-09-28):
   the indent alone carries the nesting. */

/* ── Rows: [control][pin] ───────────────────────────────────────────────── */
.snv-row{position:relative;width:var(--sidebar-w);flex:0 0 auto;}
.snv-row[hidden]{display:none !important;}

/* The shared row. Two selectors so it beats 02-sidebar.css's
   `:root.sb-open .sidebar .research-nav-btn` (0,4,0) indent in both states,
   and 03-sources.css's `.sidebar-toggle` block. */
:root .sidebar .snv-row > .snv-item,
:root.sb-open .sidebar .snv-row > .snv-item{
  position:relative;isolation:isolate;
  display:flex;align-items:center;gap:var(--snv-px);
  width:100%;height:var(--snv-h);min-height:0;
  padding:0 calc(var(--snv-in) + var(--snv-px));box-sizing:border-box;
  border:0;border-radius:0;background:transparent;box-shadow:none;
  color:var(--snv-ink);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:400;
  letter-spacing:0.005em;text-transform:none;text-decoration:none;text-align:left;
  cursor:pointer;
  transition:color .12s var(--ease-out);
}
/* The pill. Inset from both edges in the open panel; a centred square in the
   rail (see the rail block). */
.snv-item::before,
.sidebar .stock-item::before,
.sidebar .account-chip::before{
  content:"";position:absolute;z-index:-1;top:0;bottom:0;
  left:var(--snv-in);right:var(--snv-in);
  border-radius:var(--snv-r);
  background:transparent;
  transition:background .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.snv-item:hover::before{background:var(--snv-hover);}
:root .sidebar .snv-row > .snv-item:hover{background:transparent;color:var(--text-primary);}
:root .sidebar .snv-row > .snv-item.active{
  background:transparent;color:var(--text-primary);font-weight:500;
}
.snv-item.active::before{background:var(--snv-sel);}
:root .sidebar .snv-row > .snv-item:focus-visible{outline:none;}
.snv-item:focus-visible::before{box-shadow:inset 0 0 0 1px var(--accent);}

.snv-ico{flex:0 0 auto;width:var(--snv-ico);height:var(--snv-ico);color:var(--snv-ink-icon);transition:color .12s var(--ease-out), transform var(--sb-toggle);}
.snv-item:hover .snv-ico{color:var(--text-primary);}
.snv-item.active .snv-ico{color:var(--text-primary);}
.snv-label{
  flex:1 1 auto;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  opacity:0;transform:translateX(-0.375rem);
  transition:opacity var(--sb-toggle), transform var(--sb-toggle);
}
:root.sb-open .sidebar .snv-label,
:root.sb-open .sidebar .snv-head-text{opacity:1;transform:none;}

/* Destructive row. Beats 03's `#clear-unlocked-btn:hover` background. */
:root .sidebar .snv-row > #clear-unlocked-btn:hover{background:transparent;color:var(--red);}
:root .sidebar .snv-row > #clear-unlocked-btn:hover .snv-ico{color:var(--red);}
:root .sidebar .snv-row > #clear-unlocked-btn[disabled]{opacity:0.45;cursor:default;color:var(--text-secondary);}
#clear-unlocked-btn[disabled]:hover::before{background:transparent;}

/* "Not licensed" (Warden only; the row is not rendered for anyone else). */
.snv-flag{
  flex:0 0 auto;
  height:1rem;padding:0 0.3125rem;box-sizing:border-box;
  display:inline-flex;align-items:center;
  border-radius:999px;
  box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--snv-ink-quiet);
  font-size:max(0.5625rem, var(--fs-floor));font-weight:500;white-space:nowrap;
  opacity:0;transition:opacity var(--sb-toggle);
}
:root.sb-open .sidebar .snv-flag{opacity:1;}

/* Pin toggle: on hover / keyboard focus; stays lit on a pinned tool. */
.snv-pin{
  position:absolute;right:calc(var(--snv-in) + 0.25rem);top:50%;transform:translateY(-50%);
  width:1.375rem;height:1.375rem;padding:0;
  display:flex;align-items:center;justify-content:center;
  border:0;border-radius:0.25rem;background:transparent;
  color:var(--snv-ink-quiet);cursor:pointer;
  opacity:0;pointer-events:none;
  transition:opacity .12s var(--ease-out), color .12s var(--ease-out), background .12s var(--ease-out);
}
:root.sb-open .sidebar .snv-row:hover > .snv-pin,
:root.sb-open .sidebar .snv-row:focus-within > .snv-pin{opacity:1;pointer-events:auto;}
:root.sb-open .sidebar .snv-row.snv-is-pinned > .snv-pin{opacity:0.9;pointer-events:auto;color:var(--accent);}
.snv-pin:hover{color:var(--text-primary);background:var(--snv-sel);}
.snv-pin:focus-visible{outline:none;opacity:1;pointer-events:auto;box-shadow:inset 0 0 0 1px var(--accent);}
.snv-pin[aria-pressed="true"] svg path{fill:currentColor;fill-opacity:0.25;}
:root.sb-open .sidebar .snv-row:hover .snv-label,
:root.sb-open .sidebar .snv-row:focus-within .snv-label,
:root.sb-open .sidebar .snv-row.snv-is-pinned .snv-label{
  -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 1.5rem), transparent calc(100% - 0.25rem));
  mask-image:linear-gradient(to right, #000 calc(100% - 1.5rem), transparent calc(100% - 0.25rem));
}
:root.sb-open .sidebar .snv-row:hover .snv-flag,
:root.sb-open .sidebar .snv-row:focus-within .snv-flag,
:root.sb-open .sidebar .snv-row.snv-is-pinned .snv-flag{opacity:0;}

/* ── Watchlist rows (built by app.js) in the same row grammar ───────────── */
/* 03-sources.css makes .stock-item a 4rem two-line card with a seam; these
   (0,4,0) selectors turn it into a tool row: logo in the icon slot, ticker as
   the label, the company name after it in the muted tone, lock and remove on
   the right on hover. The height lives on the row, so app.js's add / remove
   collapse (which measures offsetHeight) and the drag reorder keep working. */
.wl-scroll .stock-list{width:100%;max-height:calc(12 * var(--snv-h));}
/* No scrollbar may flash during the Watchlist's open entrance (app.js sets
   this only while the rows rise, and only on a list that fits). */
.wl-scroll .stock-list.wl-noscroll{overflow-y:hidden;}
/* Page load entrance (v6, owner 2026-09-29): a lighter variant of the
   section-open one, only for the first rows of a load (app.js renderList):
   fade + 4px rise, 24ms stagger, the last row done by ~390ms. Reduced
   motion never adds the class (app.js). */
@keyframes snvRowLoad{
  from{opacity:0;transform:translateY(4px);}
  to{opacity:1;transform:none;}
}
.sidebar .stock-list.wl-entering.wl-loading .stock-item{
  animation:snvRowLoad .2s var(--ease-out) both;
}
.sidebar .stock-list.wl-loading .stock-item:nth-child(1){animation-delay:0ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(2){animation-delay:24ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(3){animation-delay:48ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(4){animation-delay:72ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(5){animation-delay:96ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(6){animation-delay:120ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(7){animation-delay:144ms;}
.sidebar .stock-list.wl-loading .stock-item:nth-child(n+8){animation-delay:168ms;}
:root .sidebar .stock-list .stock-item{
  position:relative;isolation:isolate;
  /* Logo to ticker: a tight 6px (owner, v4 2026-09-28: the logo sat too far
     from its ticker). Page rows keep --snv-px between glyph and label. */
  gap:6px;
  min-height:0;height:var(--snv-h);
  padding:0 calc(var(--snv-in) + var(--snv-px));
  border-bottom:0;background:transparent;
}
:root .sidebar .stock-list .stock-item:hover{background:transparent;}
:root .sidebar .stock-list .stock-item.active{background:transparent;}
.sidebar .stock-item:hover::before{background:var(--snv-hover);}
.sidebar .stock-item.active::before{background:var(--snv-sel);}
:root .sidebar .stock-list .si-logo,
.snv-fly .snv-fly-logo{
  /* A round logo, a little larger than the 16px glyphs, centred on the same
     icon column (the negative margin pulls its centre back onto the column).
     No ring (owner, v4 2026-09-28). */
  width:1.25rem;height:1.25rem;margin-left:calc(var(--snv-ico) / 2 - 0.625rem);border-radius:50%;
  box-shadow:none;border:0;outline:0;
  font-size:0.5rem;
  transition:transform var(--sb-toggle);
}
/* No ring at all (owner, 2026-09-29): the white logo plate peeked out as a
   thin rim around the circular clip. The image fills the disc edge to edge
   (scaled past the provider's baked-in margin) and the plate only backs a
   logo while it loads. */
:root .sidebar .stock-list .si-logo:has(img),
.snv-fly .snv-fly-logo:has(img){background:transparent;}
:root .sidebar .stock-list .si-logo img,
.snv-fly .snv-fly-logo img{
  width:100%;height:100%;object-fit:cover;border-radius:50%;
  transform:scale(1.34);
}
:root .sidebar .stock-list .si-logo.fallback,
.snv-fly .snv-fly-logo.fallback{
  /* Ticker initials on a token-coloured disc, never a broken image. */
  background:color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
  color:var(--accent);
  font-family:var(--font-sans);font-size:0.5rem;font-weight:700;letter-spacing:0.02em;
}
:root .sidebar .stock-list .si-info{
  flex-direction:row;align-items:baseline;gap:0.5rem;
  padding-right:3.75rem;           /* the quote (at rest) / lock + remove (on hover) lane */
}
/* Last price over the day's change, right aligned, fixed-width numbers, so a
   tick never moves anything. Painted by static/js/watch-quotes.js. On hover
   (or keyboard focus inside the row) it steps aside for lock + remove. */
.sidebar .si-quote{
  position:absolute;right:calc(var(--snv-in) + var(--snv-px));top:50%;transform:translateY(-50%);
  display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:1px;
  min-width:3.25rem;
  /* The vendored mono face: every digit is the same width by construction.
     (tabular-nums on the sans stack falls through to a CJK face on machines
     without Inter, whose tabular digits are full width.) */
  font-family:var(--font-mono);
  line-height:1.1;white-space:nowrap;pointer-events:none;
  transition:opacity .12s var(--ease-out);
}
.sidebar .si-q-px{font-size:max(0.75rem, var(--fs-floor));font-weight:500;color:var(--text-primary);}
.sidebar .si-q-pct{font-size:max(0.625rem, var(--fs-floor));font-weight:500;color:var(--snv-ink-quiet);}
.sidebar .si-q-up .si-q-pct{color:var(--green);}
.sidebar .si-q-down .si-q-pct{color:var(--red);}
.sidebar .si-q-none .si-q-px{color:var(--snv-ink-quiet);font-weight:400;}
/* Tick tint (owner 2026-10-05: the capsule wash "feels flashy ... just make
   the price turn green or red if the price moves or the normal color if
   nothing"): a changed last price colours the PRICE TEXT only, for FLASH_MS
   in watch-quotes.js, then eases back to the normal ink. No background. */
.sidebar .si-q-px{transition:color .6s var(--ease-out);}
.sidebar .si-q-tick-up .si-q-px{color:var(--green);transition:none;}
.sidebar .si-q-tick-down .si-q-px{color:var(--red);transition:none;}
@media (prefers-reduced-motion: reduce){
  .sidebar .si-q-px{transition:none;}
}
.sidebar .stock-item:hover .si-quote,
.sidebar .stock-item:focus-within .si-quote,
.sidebar .stock-item.dragging .si-quote{opacity:0;}
:root .sidebar .stock-list .si-sym{
  flex:0 0 auto;
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:500;
  letter-spacing:0.01em;color:var(--snv-ink);line-height:1;
}
.sidebar .stock-item:hover .si-sym,
.sidebar .stock-item.active .si-sym{color:var(--text-primary);}
:root .sidebar .stock-list .si-name{
  flex:1 1 auto;min-width:0;
  font-size:max(0.6875rem, var(--fs-floor));font-weight:400;color:var(--snv-ink-quiet);line-height:1;
}
:root .sidebar .stock-list .si-rm,
:root .sidebar .stock-list .si-lock{
  top:50%;transform:translateY(-50%);
  min-width:1.25rem;min-height:1.25rem;padding:0;
  display:flex;align-items:center;justify-content:center;
  background:transparent;border-radius:0.25rem;line-height:1;
}
:root .sidebar .stock-list .si-rm{right:calc(var(--snv-in) + 0.1875rem);font-size:0.875rem;}
:root .sidebar .stock-list .si-lock{right:calc(var(--snv-in) + 1.5rem);}
.sidebar .stock-list .si-rm:hover{background:var(--red-dim);}
.sidebar .stock-list .si-lock:hover{background:var(--snv-sel);}

/* The Watchlist folds like every other section (owner, 2026-09-28 v3).
   02-sidebar.css's `.sb-body.collapsed` / `:root.wl-shut #wl-body` already
   take the height to 0; visibility keeps the folded rows out of the tab
   order, like .snv-shut > .snv-body. */
.snv-wl > #wl-body.collapsed,
:root.wl-shut .snv-wl > #wl-body{
  visibility:hidden;
  transition:height .2s var(--ease-out), opacity .12s var(--ease-out), visibility 0s linear .2s;
}

/* ── Footer: Settings, Collapse, profile ────────────────────────────────── */
.snv-foot{
  flex-shrink:0;display:flex;flex-direction:column;
  width:var(--sidebar-w);
  padding:0.375rem 0 0.5rem;
  border-top:1px solid var(--border-sidebar);
}
/* Collapse. Beats 03's `.sidebar-toggle` uppercase / border-top block. */
:root .sidebar .snv-row > .sidebar-toggle{
  border-top:0;letter-spacing:0.005em;text-transform:none;font-weight:400;
}
.snv-ico-expand{display:none;}
:root:not(.sb-open) .sidebar .snv-ico-collapse{display:none;}
:root:not(.sb-open) .sidebar .snv-ico-expand{display:block;}

/* Profile: last in the sidebar, the reference's bottom user row. Beats 03's
   `.account-chip` / `:root.sb-open .sidebar .account-chip` padding + seam. */
:root .sidebar .snv-foot .account-chip,
:root.sb-open .sidebar .snv-foot .account-chip{
  isolation:isolate;
  width:100%;min-height:0;height:var(--snv-h);margin-top:0.125rem;
  padding:0 calc(var(--snv-in) + var(--snv-px)) 0 calc(var(--snv-in) + 0.25rem);
  gap:0.625rem;border-top:0;background:transparent;
}
:root .sidebar .snv-foot .account-chip:hover,
:root .sidebar .snv-foot .account-chip:focus-visible{background:transparent;}
.sidebar .account-chip:hover::before,
.sidebar .account-chip[aria-expanded="true"]::before{background:var(--snv-hover);}
.sidebar .account-chip:focus-visible::before{box-shadow:inset 0 0 0 1px var(--accent);}
.sidebar .snv-foot .account-avatar{
  width:var(--snv-ico);height:var(--snv-ico);border-radius:var(--snv-r);border:0;   /* the glyph box (one size, 2026-11-10; 1.75rem before) */
  box-shadow:inset 0 0 0 1px var(--border-default);
  transition:transform var(--sb-toggle);
}
.sidebar .snv-foot .account-avatar-fallback{font-size:0.625rem;}
.sidebar .snv-foot .account-name{font-size:max(0.8125rem, var(--fs-floor));font-weight:500;}
/* T9 fix B (2026-10-24): the name gets the row's full width ("maple_d..."
   was cut beside the plan word). The row wraps and shows one line: the
   plan word sits beside a name that fits and drops onto the clipped second
   line when it would squeeze the name, so the name alone shrinks to its
   ellipsis only when it is wider than the whole row. Name and email carry
   their full text as a hover title (templates/app.html). */
.sidebar .snv-foot .account-name-row{
  flex-wrap:wrap;overflow:hidden;
  max-height:calc(max(0.8125rem, var(--fs-floor)) * 1.3);
}
.sidebar .snv-foot .account-name{min-width:0;max-width:100%;}
.sidebar .snv-foot .account-email{font-size:max(0.6875rem, var(--fs-floor));color:var(--snv-ink-quiet);}
.sidebar .snv-foot .account-caret{color:var(--snv-ink-quiet);}
.sidebar .snv-foot .account-chip[aria-expanded="true"] .account-caret{transform:none;}

/* ── Plan tag (v7, owner 2026-09-29) ───────────────────────────────────────
   The tier next to the user's name, in the profile row and the account
   menu. Owner: no dots, professional colours. Plain small uppercase text at
   wide tracking, no container, no ornament; the tier shows only through a
   neutral ink step (Squire and Knight muted, Banneret secondary, Warden full
   ink), the way plan markers read in Linear, Vercel or Stripe. Beats
   03-sources.css `.account-role` (0,1,0) and lib/menu.css `.mpm-user-tag`
   (0,1,0); the shared .role-* pills are not on these two tags. */
.sidebar .snv-tier,
#account-menu .snv-tier{
  flex:0 0 auto;
  display:inline-flex;align-items:center;
  height:auto;padding:0;margin-left:0.125rem;
  border-radius:0;background:transparent;box-shadow:none;
  color:var(--tier-ink);
  font-family:var(--font-sans);font-size:var(--fs-label);font-weight:500;
  letter-spacing:normal;text-transform:none;line-height:1;
  white-space:nowrap;
}
/* A laptop width sidebar keeps the account name whole: the plan word moves
   to the account menu alone (2026-10-07: "Local …" was cut at 1280). */
@media (max-width:1439.98px){ .sidebar .snv-tier{display:none;} }
#account-menu .snv-tier{margin-left:auto;}
.sidebar .snv-tier::before,
#account-menu .snv-tier::before{content:none;display:none;}
.sidebar .snv-tier-banneret,
#account-menu .snv-tier-banneret{color:var(--tier-ink-mid);}
.sidebar .snv-tier-warden,
#account-menu .snv-tier-warden{color:var(--tier-staff-ink);}

/* ── Filtering ──────────────────────────────────────────────────────────── */
.sidebar.snv-filtering .snv-group.snv-nohit,
.sidebar.snv-filtering .snv-pinned,
.sidebar.snv-filtering .snv-wl{display:none;}
.sidebar.snv-filtering .snv-shut > .snv-body{height:auto;opacity:1;visibility:visible;}
.sidebar.snv-filtering .snv-shut > .snv-head .snv-chev{transform:none;}

/* ── The icon-only rail (v3, 2026-09-28) ─────────────────────────────────── */
/* ONE icon per GROUP, not per tool: the rail was a column of ~40 icons. In
   the rail every group body folds away and its heading becomes a single icon
   button (.snv-gico) that opens a flyout of the group's pages (sidenav.js,
   #snv-fly). Kept at the top: Search, Home and up to five pinned tools; at
   the bottom: Settings, Collapse and the avatar. */
/* Each SECTION has its own glyph (never one of its pages' icons): small
   beside the heading in the open panel, the whole button in the rail. */
.snv-gico{display:block;flex:0 0 auto;width:var(--snv-ico);height:var(--snv-ico);color:var(--snv-ink-icon);
  transition:color .12s var(--ease-out), transform var(--sb-toggle);}
.snv-head:hover .snv-gico{color:var(--text-primary);}
/* Icons, logos and the avatar move onto the rail's centre line. (0,5,0) beats
   02's `:root:not(.sb-open) .sidebar .research-nav-btn svg` (0,4,1). */
/* SUPERSEDED 2026-11-10 (Ali: one size open and collapsed): --snv-rail-scale is
   now 1, so this rule only keeps the glyph on its column. History:
   rail glyphs were LARGER than the open panel's (owner, 2026-09-29: "make
   symbols bigger when collapsed"): 16px -> 20px (18px under 1180px, where
   the rail square is only ~27px). Done with a scale on the same transform
   the toggle already eases (--sb-toggle), NOT by changing --snv-ico: the
   16px box keeps the layout, the glyph column and the centring identical in
   both states, so the size glides with the clip edge instead of snapping,
   and the default transform-origin (centre) keeps every glyph on the rail's
   centre line. The flyout's clones are .snv-fly-item, not .snv-item, so
   they keep their 16px. */
:root:not(.sb-open) .sidebar .snv-item .snv-ico,
:root:not(.sb-open) .sidebar .snv-search-btn .snv-ico,
:root:not(.sb-open) .sidebar .snv-head .snv-gico{
  transform:translateX(var(--snv-rail-shift)) scale(var(--snv-rail-scale));
  /* 1.75 x 1.25 renders ~1.46px, a hair heavier than the old 1.33px rail
     line and lighter than Lucide's 1.67px at 20px: crisp, not chunky, and
     the same stroke value as the open panel so nothing steps mid-toggle. */
  stroke-width:1.75;
}
:root:not(.sb-open) .sidebar .snv-foot .account-avatar{
  transform:translateX(calc(var(--rail-w) / 2 - var(--snv-in) - 0.25rem - 0.875rem));
}
/* The pill becomes a centred square (the reference rail's ghost button). */
:root:not(.sb-open) .sidebar .snv-item::before,
:root:not(.sb-open) .sidebar .account-chip::before,
:root:not(.sb-open) .sidebar .snv-head::before{
  left:calc(var(--rail-w) / 2 - var(--snv-h) / 2);
  right:calc(100% - var(--rail-w) / 2 - var(--snv-h) / 2);
}
/* Rail rows keep the open panel's --snv-h (2026-11-10 one size), so a glyph
   never moves vertically on the toggle, and its stroke stays the open 1.75. */
/* Group heading = one rail button. */
:root:not(.sb-open) .sidebar .snv-head{
  isolation:isolate;height:var(--snv-h);margin:0;cursor:pointer;
  padding:0 calc(var(--snv-in) + var(--snv-px));
}
.snv-head::before{
  content:"";position:absolute;z-index:-1;top:0;bottom:0;
  left:var(--snv-in);right:var(--snv-in);border-radius:var(--snv-r);
  background:transparent;transition:background .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
:root.sb-open .sidebar .snv-head:hover::before{background:var(--snv-hover);}
:root.sb-open .sidebar .snv-head:focus-visible::before{box-shadow:inset 0 0 0 1px var(--accent);}
:root:not(.sb-open) .sidebar .snv-head:hover::before,
:root:not(.sb-open) .sidebar .snv-head.snv-fly-open::before{background:var(--snv-hover);}
:root:not(.sb-open) .sidebar .snv-head:hover .snv-gico,
:root:not(.sb-open) .sidebar .snv-head.snv-fly-open .snv-gico{color:var(--text-primary);}
/* The group you are in is lit, like a selected row. */
:root:not(.sb-open) .sidebar .snv-head.snv-has-active::before{background:var(--snv-sel);}
:root:not(.sb-open) .sidebar .snv-head.snv-has-active .snv-gico{color:var(--text-primary);}
:root:not(.sb-open) .sidebar .snv-head:focus-visible::before{box-shadow:inset 0 0 0 1px var(--accent);}
:root:not(.sb-open) .sidebar .snv-head-text,
:root:not(.sb-open) .sidebar .snv-chev{opacity:0;}
/* Bodies fold away in the rail; the flyout shows them instead. (1,4,0)
   beats 02's `:root.wl-shut #wl-body` and `.sb-body.collapsed`. */
:root:not(.sb-open) .sidebar .snv-group[data-snv-group]:not(.snv-plain):not(.snv-pinned) > .snv-body,
:root:not(.sb-open) .sidebar .snv-wl > #wl-body{
  height:0;opacity:0;visibility:hidden;pointer-events:none;
}
.sidebar .snv-group{transition:margin var(--sb-toggle);}
:root:not(.sb-open) .sidebar .snv-group,
:root:not(.sb-open) .sidebar .wl-scroll > .snv-group:first-child{margin-top:0;}
/* The rail's hairline under Search is drawn, not laid out (2026-11-10 one size): a border + padding here pushed
   every row below it ~5px down on collapse, so the glyphs moved vertically mid toggle. */
:root:not(.sb-open) .sidebar .wl-scroll{box-shadow:inset 0 1px 0 var(--border-sidebar);}
/* Sidebar lines (v4, owner 2026-09-28): the panel's outer edge and every
   divider inside it use the quieter --border-sidebar token (tokens.css).
   Beats 02-sidebar.css's `.sidebar::after` and `.sidebar-brand` seams by
   source order at equal / higher specificity. */
.sidebar::after{background:var(--border-sidebar);}
.sidebar .sidebar-brand{border-bottom-color:var(--border-sidebar);}
/* Top block: Search + Home only (All Tools lives in the flyout-less panel). */
:root:not(.sb-open) .sidebar #snv-g-top .snv-row[data-snv-for="rs-label"]{display:none;}
/* Pinned: icons only, at most five, no heading. */
:root:not(.sb-open) .sidebar .snv-pinned > .snv-head{display:none;}
:root:not(.sb-open) .sidebar .snv-pinned{margin-top:0;padding-bottom:0;}
:root:not(.sb-open) .sidebar .snv-pinned .snv-row:nth-child(n+6){display:none;}
:root:not(.sb-open) .sidebar .snv-shut.snv-pinned > .snv-body{height:auto;opacity:1;visibility:visible;}
:root:not(.sb-open) .sidebar .snv-input,
:root:not(.sb-open) .sidebar .snv-kbd{opacity:0;pointer-events:none;}
:root:not(.sb-open) .sidebar .snv-input{visibility:hidden;}
:root:not(.sb-open) .sidebar .snv-search-btn{pointer-events:auto;}
:root:not(.sb-open) .sidebar .snv-search-btn:hover,
:root:not(.sb-open) .sidebar .snv-search-btn:focus-visible{outline:none;color:var(--text-primary);}
:root:not(.sb-open) .sidebar .snv-empty{display:none;}
:root:not(.sb-open) .sidebar .snv-foot{padding-top:0.25rem;}

/* ── The rail flyout (a direct child of the aside, outside the clip) ────── */
.snv-fly{
  position:fixed;left:0;top:0;z-index:69;
  width:14rem;max-height:calc(100vh - 1rem);overflow-y:auto;overscroll-behavior:contain;
  padding:0.375rem 0;box-sizing:border-box;
  border-radius:0.5rem;
  background:var(--bg-elevated);
  box-shadow:inset 0 0 0 1px var(--border-default), var(--shadow-pop);
  --snv-in:0.375rem;--snv-px:0.625rem;--snv-h:2rem;
  /* Motion (v4): closed state is transparent, 6px toward the rail and a hair
     small; .snv-fly-on eases it in (160ms), removing it eases out a little
     faster (110ms, sidenav.js FLY_OUT_MS waits for it). While open, `top`
     glides so moving between section icons never replays close + open. */
  opacity:0;transform:translateX(-6px) scale(0.98);transform-origin:left top;
  pointer-events:none;
  transition:opacity .11s var(--ease-out), transform .11s var(--ease-out), top .14s var(--ease-out);
}
.snv-fly.snv-fly-on{
  opacity:1;transform:none;pointer-events:auto;
  transition:opacity .16s var(--ease-out), transform .16s var(--ease-out), top .14s var(--ease-out);
}
.snv-fly.snv-fly-noglide{transition:none;}
.snv-fly[hidden]{display:none;}
/* Switching section while open: the new rows crossfade in. */
.snv-fly.snv-fly-swap > *{animation:snvFlySwap .14s var(--ease-out);}
@keyframes snvFlySwap{from{opacity:0.25;}to{opacity:1;}}
/* The flyout's title is the section heading, in the open panel's heading
   type (v7): semibold, primary ink, title case. */
.snv-fly-title{
  padding:0.375rem calc(var(--snv-in) + var(--snv-px)) 0.375rem;
  color:var(--snv-ink-head);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:600;
  letter-spacing:0.01em;text-transform:none;
}
.snv-fly .snv-row{width:100%;}
.snv-fly .snv-fly-item{
  position:relative;isolation:isolate;
  display:flex;align-items:center;gap:var(--snv-px);
  width:100%;height:var(--snv-h);
  padding:0 calc(var(--snv-in) + var(--snv-px));box-sizing:border-box;
  border:0;background:transparent;color:var(--snv-ink);
  font-family:var(--font-sans);font-size:max(0.8125rem, var(--fs-floor));font-weight:400;
  text-align:left;text-decoration:none;cursor:pointer;outline:none;
}
.snv-fly .snv-fly-item::before{
  content:"";position:absolute;z-index:-1;top:0;bottom:0;left:var(--snv-in);right:var(--snv-in);
  border-radius:var(--snv-r);background:transparent;
}
.snv-fly .snv-fly-item:hover::before,
.snv-fly .snv-fly-item:focus-visible::before{background:var(--snv-hover);}
.snv-fly .snv-fly-item:focus-visible::before{box-shadow:inset 0 0 0 1px var(--accent);}
.snv-fly .snv-fly-item:hover,.snv-fly .snv-fly-item:focus-visible{color:var(--text-primary);}
.snv-fly .snv-fly-item.active{color:var(--text-primary);font-weight:500;}
.snv-fly .snv-fly-item.active::before{background:var(--snv-sel);}
.snv-fly .snv-ico{color:var(--snv-ink-icon);}
.snv-fly .snv-fly-item.active .snv-ico,.snv-fly .snv-fly-item:hover .snv-ico{color:var(--text-primary);}
.snv-fly .snv-label{opacity:1;transform:none;}
.snv-fly .snv-flag{opacity:1;}
/* A stock in the Watchlist flyout, the open panel's row: round logo in the
   icon slot, the ticker, and the live figure on the right (.si-quote,
   painted by watch-quotes.js; the `.sidebar .si-quote` rules above apply,
   the flyout being a child of the aside). */
.snv-fly .snv-fly-logo{
  flex:0 0 auto;overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  color:var(--text-secondary);font-weight:700;
}

.snv-fly .snv-fly-item[data-fly-stock]{gap:6px;padding-right:calc(var(--snv-in) + var(--snv-px) + 3.5rem);}
.snv-fly .snv-fly-sym{flex:1 1 auto;min-width:0;font-weight:500;color:inherit;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.snv-fly-empty{padding:0.375rem calc(var(--snv-in) + var(--snv-px));color:var(--snv-ink-quiet);
  font-size:max(0.75rem, var(--fs-floor));}

/* ── Rail tooltip (a direct child of the aside, outside the clip) ───────── */
.snv-tip{
  position:fixed;left:0;top:0;z-index:70;
  transform:translateY(-50%);
  padding:0.3125rem 0.5rem;
  border-radius:var(--radius-sm);
  background:var(--bg-elevated);
  box-shadow:inset 0 0 0 1px var(--border-default), var(--shadow-pop);
  color:var(--text-primary);
  font-family:var(--font-sans);font-size:max(0.75rem, var(--fs-floor));font-weight:500;
  white-space:pre;pointer-events:none;
  opacity:0;transition:opacity .1s var(--ease-out);
}
.snv-tip[hidden]{display:none;}
.snv-tip.snv-tip-on{opacity:1;}

/* Narrow windows: --sidebar-w bottoms out near 9rem of 12px type, so the
   pills tighten and the "Not licensed" marker shrinks to a dot (its title
   still says it) rather than eating the tool's name. */
@media (max-width:1180px){
  .sidebar{--snv-in:0.25rem;--snv-px:0.5rem;}
  :root.sb-open .sidebar .snv-flag{
    width:0.4375rem;height:0.4375rem;padding:0;font-size:0;
    border-radius:50%;box-shadow:none;background:var(--snv-ink-quiet);
  }
}

@media (prefers-reduced-motion: reduce){
  .snv-body,.snv-shut > .snv-body,.snv-chev,.snv-tip,.snv-label,.snv-ico,.snv-gico,.snv-item::before,
  .snv-fly,.snv-fly.snv-fly-on{transition:none !important;}
  .snv-fly{transform:none;}
  .snv-fly.snv-fly-swap > *{animation:none;}
}

/* ══ Collapse / expand motion (v5, owner 2026-09-29) ═══════════════════════
   "Not fancy, just smooth":
   1. ONE width ease: the clip edge, the seam and .main's push share 220ms
      ease-out (this redefines 02-sidebar.css's --sb-toggle, which every
      toggle property already reads). Collapsing waits 80ms so the labels are
      gone before the edge moves; expanding starts at once and the labels
      fade in once the edge has passed them (body.sb-toggling, set by app.js
      for the length of a toggle, scopes that sequencing so hover fades keep
      their own quick clocks).
   2. Nothing slides sideways. Every glyph sits on ONE column in both states,
      centred on the rail's centre line (--snv-col), so the rail needs no
      shift at all; labels fade in place (no translate, no squashing: the
      panel is always laid out at full width and only the clip moves).
   3. The knight keeps its own open and rail sizes (v6) and moves between
      them on one transform on the same clock; the wordmark fades. */
:root{ --sb-toggle:.22s var(--ease-out); }
.sidebar{
  --snv-col:calc(var(--rail-w) / 2 - var(--snv-ico) / 2);
  --snv-rail-shift:0px;
}
/* One glyph column (left edge = --snv-col) for rows, headings, stock rows,
   search, and one indent step in for a section's pages. */
:root .sidebar .snv-row > .snv-item,
:root.sb-open .sidebar .snv-row > .snv-item,
:root.sb-open .sidebar .snv-head,
:root:not(.sb-open) .sidebar .snv-head,
:root .sidebar .stock-list .stock-item{padding-left:var(--snv-col);}
:root.sb-open .sidebar .snv-group:not(.snv-plain) > .snv-body .snv-row > .snv-item,
:root.sb-open .sidebar .snv-wl .stock-list .stock-item{
  padding-left:calc(var(--snv-col) + var(--snv-indent));
}
.sidebar .snv-search-btn{width:calc(var(--snv-col) + var(--snv-ico));padding-left:var(--snv-col);}
.sidebar .snv-input{padding-left:calc(var(--snv-col) + var(--snv-ico) + var(--snv-px) - var(--snv-in));}
/* The avatar is centred on the same line in both states. */
:root .sidebar .snv-foot .account-chip,
:root.sb-open .sidebar .snv-foot .account-chip{padding-left:var(--snv-col);}
:root:not(.sb-open) .sidebar .snv-foot .account-avatar{transform:none;}

/* Labels fade in place; they never translate. */
.sidebar .snv-label,.sidebar .snv-head-text,.sidebar .si-info,
.sidebar .account-meta,.sidebar .sb-text,
:root.sb-open .sidebar .snv-label,:root.sb-open .sidebar .snv-head-text,
:root.sb-open .sidebar .si-info,:root.sb-open .sidebar .account-meta,
:root.sb-open .sidebar .sb-text{transform:none;}
/* Collapse: labels out first (80ms), then the edge. */
:root:not(.sb-open) body.sb-toggling .sidebar :is(.snv-label,.snv-head-text,.snv-chev,.snv-flag,
  .snv-input,.snv-kbd,.sb-text,.si-info,.si-quote,.account-meta,.account-caret){
  transition:opacity .08s linear, visibility 0s linear .08s;
}
:root:not(.sb-open) body.sb-anim .sidebar .sidebar-clip{transition:clip-path .22s var(--ease-out) .08s;}
/* The rail glyphs grow on the edge's clock (they shrink back at once on
   expand, the base .snv-ico / .snv-gico transition). */
:root:not(.sb-open) body.sb-toggling .sidebar :is(.snv-item .snv-ico,.snv-search-btn .snv-ico,.snv-head .snv-gico){
  transition:color .12s var(--ease-out), transform .22s var(--ease-out) .08s;
}
:root:not(.sb-open) body.sb-anim .sidebar::after{transition:left .22s var(--ease-out) .08s;}
/* No stylesheet transition on .main's margin: app.js (pushMain) drives it
   inline on this same clock for the toggle only, with the chart block pinned
   so it never resizes mid motion (04-header.css .sb-pushing). A CSS
   transition here would also replay on every non toggle margin change. */
body.sb-anim:not(.chart-zen) .main,
:root.sb-open body.sb-anim:not(.chart-zen) .main,
:root:not(.sb-open) body.sb-anim:not(.chart-zen) .main{transition:none;}
/* Expand: the edge at once, the labels once it has passed them. */
:root.sb-open body.sb-toggling .sidebar :is(.snv-label,.snv-head-text,.snv-chev,.snv-flag,
  .snv-input,.snv-kbd,.sb-text,.si-info,.si-quote,.account-meta,.account-caret){
  transition:opacity .14s var(--ease-out) .14s, visibility 0s linear 0s;
}

/* The brand (v6, owner 2026-09-29: keep the logo's own two states, only
   make the change between them smooth). The lockup is always LAID OUT in
   its open geometry (02-sidebar.css's open padding, knight height and
   wordmark), and the rail state is that same box moved and scaled onto the
   rail's centre line by ONE transform, so the change is a single
   compositor-only interpolation on the width's clock: no layout, no jump at
   the end. sidenav.js measures the two numbers CSS cannot compute (how far
   the knight's open centre is from the rail's centre, and the rail knight's
   size as a fraction of the open one) into --brand-dx / --brand-s /
   --brand-ox; the fallbacks are close enough for the one frame before it
   runs. The wordmark fades with the other labels. */
.sidebar .sidebar-brand,
:root.sb-open .sidebar .sidebar-brand{
  position:relative;
  padding:0 calc(var(--sidebar-w) * 0.064);
  transition:background .15s var(--ease-out);
}
.sidebar .sidebar-brand video,
.sidebar .sidebar-brand .brand-img,
:root.sb-open .sidebar .sidebar-brand video,
:root.sb-open .sidebar .sidebar-brand .brand-img{
  /* ONE knight size open and collapsed (2026-11-10; open was --sidebar-w * 0.264, rail 3.25rem).
     2026-11-17 (owner: "why is it so small?"): x1.35, then "a little big": x1.2 with the wordmark, 3.9rem.
     The art is 59% of the canvas height, so the header keeps its height and
     the room above and below it stays even; the 384x256 PNG and the
     1176x784 webm are both drawn below their own size (crisp). */
  height:3.9rem;
  /* The art starts 38.7% of a height in from the canvas's left edge (99 of
     256 px): pulling that empty margin back centres what you SEE (knight +
     wordmark) in the header, so the larger wordmark keeps its room on the
     right; and the art sits 2.4% of a height high in its canvas, so it
     drops by that much to leave even room above and below. */
  margin-left:calc(3.9rem * -0.387);
  position:relative;top:calc(3.9rem * 0.024);
  transition:transform .22s var(--ease-out);   /* the hover pop only */
}
.sidebar .sidebar-brand .sb-text,
:root.sb-open .sidebar .sidebar-brand .sb-text{
  /* x1.2 with the knight (2026-11-17, was x1.35): the wordmark's size, its room and
     its pull into the knight canvas's empty right margin. */
  font-size:calc(var(--sidebar-w) * 0.0768);
  max-width:6.2rem;margin-left:calc(var(--sidebar-w) * -0.0546);
}
.sidebar .sidebar-brand .brand-lockup,
:root.sb-open .sidebar .sidebar-brand .brand-lockup{
  transform-origin:var(--brand-ox, 25%) 50%;
  transform:none;
}
:root:not(.sb-open) .sidebar .sidebar-brand .brand-lockup{
  transform:translateX(var(--brand-dx, calc((var(--rail-w) - var(--sidebar-w)) / 2))) scale(var(--brand-s, 0.76));
}
/* Same clock as the clip edge: collapse waits for the labels, expand starts
   at once. */
:root:not(.sb-open) body.sb-anim .sidebar .sidebar-brand .brand-lockup{transition:transform .22s var(--ease-out) .08s;}
:root.sb-open body.sb-anim .sidebar .sidebar-brand .brand-lockup{transition:transform .22s var(--ease-out);}

/* ── Screener sync section inside the Watchlist (2026-10-02) ───────────────
   The stocks a Rotate sync holds, under one quiet heading: plain text, the
   count after a middot. No rule, stripe, fill or glow (owner rules). Hidden
   when there is nothing to show, and in the collapsed rail. */
.wl-sync[hidden]{display:none;}
.wl-sync-head{
  display:flex;align-items:baseline;gap:0.375rem;
  padding:0.5rem 0.75rem 0.25rem 0.75rem;
  font-size:max(0.6875rem, var(--fs-floor));font-weight:600;color:var(--text-muted);
  white-space:nowrap;overflow:hidden;
}
.wl-sync-n{font-weight:500;font-variant-numeric:tabular-nums;}
.wl-sync-n::before{content:'\00B7';margin-right:0.375rem;}
:root:not(.sb-open) .wl-sync-head{display:none;}
.snv-action-row[hidden]{display:none;}

/* ── Function code chip (2026-10-05) ──────────────────────────────────────
   Each tool row carries its function code (_sidenav_macros.html). Owner:
   codes in the menu at rest would crowd it, so the chip shows ONLY while a
   search is typed (.snv-filtering), where it says why a row matched. The pin
   toggle steps aside for it while filtering. Same font, the small size, the
   quiet ink, an inset ring (a 1px border bowties in headless shots). */
.snv-code{display:none;}
.sidebar.snv-filtering .snv-item .snv-code{
  flex:0 0 auto;display:inline-flex;align-items:center;
  height:1.125rem;padding:0 0.3125rem;margin-left:0.375rem;box-sizing:border-box;
  border-radius:0.25rem;box-shadow:inset 0 0 0 1px var(--border-default);
  color:var(--snv-ink-quiet);
  font-family:var(--font-sans);font-size:max(0.6875rem, var(--fs-floor));font-weight:500;
  letter-spacing:0.04em;line-height:1;
}
.sidebar.snv-filtering .snv-item.active .snv-code{color:var(--text-secondary);}
.sidebar.snv-filtering .snv-pin{display:none;}
:root:not(.sb-open) .sidebar .snv-code{display:none !important;}

/* ── Section headings vs pages (v7, owner 2026-10-04) ──────────────────────
   "Make the left side panel sections a little easier to understand; make
   the header sections a little more bolder." Three quiet cues, no lines:
   1. weight and ink: headings semibold in primary ink (.snv-head above);
   2. the heading glyph sits a step above the page glyphs (open panel only;
      in the rail the heading IS the button and keeps the rail's inks);
   3. an open section ends with a little air before the next heading, so
      each section reads as one block. Folded headings stay tight. */
:root.sb-open .sidebar .snv-head .snv-gico{color:var(--snv-ink);}
:root.sb-open .sidebar .snv-head:hover .snv-gico,
:root.sb-open .sidebar .snv-head:focus-visible .snv-gico{color:var(--text-primary);}
:root.sb-open .sidebar .wl-scroll > .snv-group:not(.snv-shut) + .snv-group,
:root.sb-open .sidebar .snv-top > .snv-group:not(.snv-shut) + .snv-group:not([hidden]){margin-top:var(--snv-head-gap);}
:root.sb-open .sidebar .wl-scroll > .snv-wl:has(> .snv-head[aria-expanded="false"]) + .snv-group{margin-top:0.125rem;}
/* The Watchlist's own "Screener sync" sub heading sits on its stocks'
   column (one indent step in), so it reads as part of the Watchlist and
   never as a section of its own. */
:root.sb-open .sidebar .wl-sync-head{padding-left:calc(var(--snv-col) + var(--snv-indent));}
/* Narrow windows: the semibold heading gives back its tracking first. */
@media (max-width:1180px){
  .sidebar .snv-head{letter-spacing:0;}
}
/* Collapsed rail flyout: a market's icon (static/img/markets, PR #271) is
   already round and full bleed, so no plate or crop, plus a hairline ring
   for pale flags on the light theme. Mirrors .si-logo.mkt-icon in
   45-markets.css; lives here because this file owns the .snv- namespace. */
.snv-fly .snv-fly-logo.mkt-icon{
  border-radius:50%;
  background:transparent;
  outline:1px solid color-mix(in srgb, var(--text-primary) 14%, transparent);
  outline-offset:-1px;
}
.snv-fly .snv-fly-logo.mkt-icon img{
  transform:none;object-fit:contain;border-radius:50%;
}


/* ── UX fix pass (2026-10-05) ── */
/* The watchlist well's scrollbar: Chrome ignores the ::-webkit-scrollbar
   styling (03-sources.css, the slim thumb, no arrow buttons) on any element
   that sets scrollbar-width or scrollbar-color, and falls back to the
   browser's own bar with arrows. Where the webkit styling exists, use it;
   Firefox keeps the standard thin bar. */
@supports selector(::-webkit-scrollbar){
  .sidebar .stock-list{scrollbar-width:auto;scrollbar-color:auto;}
}
/* A narrow panel: the ticker gives way with an ellipsis before it can run
   into the quote (it never ran under it: the quote lane is reserved). */
:root .sidebar .stock-list .si-info{min-width:0;overflow:hidden;}
:root .sidebar .stock-list .si-sym{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* Owner 2026-10-06: the company name crowded the ticker ("just the ticker
   and price and percentage"). The row keeps its name span (workspace panes
   read it) but never shows it. */
:root .sidebar .stock-list .si-name{display:none;}
/* At 900px and under the open panel is a drawer OVER the content (it
   starts closed there: app.js sbNarrow), so it can take a comfortable
   width instead of the 11.25rem floor that cut tickers short. */
@media (max-width:900px){
  :root{--sidebar-w:15rem;}
}

/* ═══ PHONE (2026-10-14): the sidebar as the full screen Watchlist / More
   sheet. The phone layout's switch is :root.phone (app.html's head,
   window.MPPhone) and its own file is 77-phone.css; the rules that style
   this file's .snv-* rows live HERE, so .snv- stays owned by one file.
   The desktop rows are 2rem (28px on a phone) with 13px labels; a thumb
   needs 44px, and the sheet has the whole screen. ════════════════════ */
:root.phone .snv-row:has(> #sidebar-toggle){display:none;}
:root.phone .sidebar .snv-row > .snv-item,
:root.phone.sb-open .sidebar .snv-row > .snv-item{font-size:15px;}
:root.phone .sidebar .snv-head{min-height:44px;font-size:13px;}
:root.phone .snv-top{padding-top:calc(8px + env(safe-area-inset-top, 0px));}
:root.phone .snv-search{height:44px;margin:0 12px 6px;}
:root.phone .sidebar .snv-foot{flex:none;}
:root.phone .snv-search{margin:0 12px 6px;width:auto;}
:root.phone .sidebar .wl-scroll,
:root.phone .sidebar .snv-top,
:root.phone .sidebar .snv-foot,
:root.phone .sidebar .snv-row,
:root.phone .sidebar .stock-list,
:root.phone .sidebar .stock-list .stock-item,
:root.phone .sidebar .snv-group,
:root.phone .sidebar .snv-body{width:100%;max-width:100%;box-sizing:border-box;}
/* 16px or iOS Safari zooms the page in on focus. */
:root.phone .snv-input{font-size:16px;}

/* ═══ PHONE, run 2 (2026-10-17): quick checks only ════════════════════════
   Owner: the phone is "for quick chart, prices and portfolio checks, not
   really using the tools". The sheet keeps the Watchlist (its own group,
   with Add symbol), the top Ask / Home row and an ALLOWLIST of simple rows:
   Market movers, Heatmap, Economic calendar, Earnings calendar, Positions &
   P/L, Alerts and Competitions (2026-11-13: a competition trader must be
   able to find the leaderboard again from the sheet). Every other group (Pinned, Supply chain, Screening,
   Research desk, Admin, Help) and every other row goes, so a tool added
   later stays off the phone until it is named here. The footer (Chat,
   Settings, account) is outside the groups and stays. A tool page reached
   by a link still opens. Desktop and tablets are untouched. */
:root.phone .sidebar .snv-group[data-snv-group]:not([data-snv-group="top"]):not([data-snv-group="markets"]):not([data-snv-group="corporate"]):not([data-snv-group="portfolio"]){
  display:none !important;
}
:root.phone .sidebar .snv-group[data-snv-group] .snv-row:not([data-snv-for="chat-page-nav-btn"]):not([data-snv-for="wl-label"]):not([data-snv-for="movers-nav-btn"]):not([data-snv-for="heatmap-nav-btn"]):not([data-snv-for="econ-nav-btn"]):not([data-snv-for="earnings-nav-btn"]):not([data-snv-for="wt-label"]):not([data-snv-for="alerts-nav-btn"]):not([data-snv-for="comp-nav-btn"]){
  display:none !important;
}
/* The Workspaces preset rows under the (hidden) Workspaces row. */
:root.phone .sidebar #wks-side{display:none !important;}

/* Scrollbars (2026-11-08): the app's slim bar (03-sources.css), a padded thumb on a transparent track;
   Chrome draws its own bar with arrow buttons when scrollbar-width is set, so where the webkit styling
   exists it gets that instead (the watchlist well above). */
.snv-fly{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;}
.snv-fly::-webkit-scrollbar{width:8px;height:8px;}
.snv-fly::-webkit-scrollbar-track{background:transparent;}
.snv-fly::-webkit-scrollbar-thumb{background:var(--border-default);border-radius:99px;border:2px solid transparent;background-clip:padding-box;}
@supports selector(::-webkit-scrollbar){ .snv-fly{scrollbar-width:auto;scrollbar-color:auto;} }

/* 2026-11-10 (Ali: "make the logos big and don't put them in a box", then "ALL the symbols, match the sizes"). On
   the collapsed rail the Cataphract mark takes the same size as every other glyph (--snv-ico, 20px) and never
   sits on the hover / selected pill; it still brightens to the primary text colour when it is the open page. */
:root:not(.sb-open) .sidebar #chat-page-nav-btn::before,
:root:not(.sb-open) .sidebar #chat-page-nav-btn:hover::before,
:root:not(.sb-open) .sidebar #chat-page-nav-btn.active::before{background:transparent;}
