/* Vision AI — Muse-pattern drawer + settings (2026-11-03, Kelvin's order).
   Drawer: app title, small-caps section labels, flat rows with outline icons,
   active view in a soft pill, SIDE CHATS under a divider, and a pinned bottom
   bar (settings gear · search · new chat). Settings: plan card on top, then
   grouped white-card rows with chevrons that open the real setting pages.
   Tokens/type follow DESIGN.md; colors use the theme rgb vars so light and
   dark both work. Loaded after the base sheets — overrides live here.
   Icon standard (2026-11-03 upgrade): one stroke system — 24x24 grid,
   stroke-width 1.7, round caps/joins, fill none, 22px rendered for every
   primary glyph (nav rows, settings rows, bottom-bar buttons); icons sit
   muted (--muted-2) by default and take the full foreground tone on
   hover / on the active row. No emoji glyphs in drawer chrome. */

/* ---------- Drawer shell: scroll area + pinned bar ---------- */
.drawer-panel{overflow:hidden;padding:0;gap:0}
.drawer-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;
  padding:calc(var(--safe-t) + 16px) 14px 14px calc(var(--safe-l) + 14px)}
.drawer-x{position:absolute;top:calc(var(--safe-t) + 10px);right:10px;z-index:3}
.drawer-title{font-size:27px;font-weight:800;letter-spacing:-.02em;line-height:1.1;padding:2px 6px 0;color:var(--fg)}
.drawer-sec-label{font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted-2);padding:0 12px;margin-top:2px}
.drawer-account{border-radius:16px}

/* ---------- Flat nav rows ---------- */
.drawer-nav{gap:2px}
.drawer-nav>li{animation:cardIn .4s var(--ease-out) both;animation-delay:calc(var(--i, 0) * 25ms + 80ms)}
.drawer-nav a,.drawer-nav .drawer-act{display:flex;align-items:center;gap:13px;min-height:48px;height:auto;
  padding:0 12px;border-radius:14px;font-size:16px;font-weight:550;color:rgba(var(--fg-rgb),.88);
  transition:background-color .18s var(--ease-out);-webkit-tap-highlight-color:transparent}
.drawer-nav a:hover,.drawer-nav .drawer-act:hover{background:rgba(var(--fg-rgb),.06)}
.drawer-nav a[aria-current="page"]{background:rgba(var(--fg-rgb),.1);color:var(--fg)}
.drawer-nav .drawer-ic{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;font-size:19px;
  color:var(--muted-2);transition:color .18s var(--ease-out)}
.drawer-nav a:hover .drawer-ic,.drawer-nav .drawer-act:hover .drawer-ic{color:var(--fg)}
.drawer-nav a[aria-current="page"] .drawer-ic{color:var(--fg)}
.drawer-nav .drawer-ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
.drawer-nav li.dsearch-hide{display:none}
.drawer-divider{height:1px;background:var(--line);margin:8px 6px 2px;flex:none}

/* ---------- Side chats ---------- */
.side-chats{display:flex;flex-direction:column;gap:2px;list-style:none;margin:0;padding:0}
.sc-item{position:relative}
.sc-main{display:flex;align-items:center;gap:8px;width:100%;min-height:46px;padding:7px 12px;border:0;
  border-radius:12px;background:transparent;color:rgba(var(--fg-rgb),.88);font-size:15px;font-weight:500;
  text-align:left;cursor:pointer;transition:background-color .18s var(--ease-out);-webkit-tap-highlight-color:transparent}
.sc-main:hover{background:rgba(var(--fg-rgb),.06)}
.sc-item.is-current .sc-main{background:rgba(var(--fg-rgb),.07);color:var(--fg)}
.sc-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-pin{font-size:11px;opacity:.75;flex:none}
.sc-dot{width:8px;height:8px;border-radius:50%;background:var(--gold);flex:none;margin-left:2px}
.sc-more{position:absolute;top:50%;right:6px;transform:translateY(-50%);width:30px;height:30px;border:0;
  border-radius:50%;background:transparent;color:var(--muted);font-size:13px;letter-spacing:1px;cursor:pointer;opacity:0}
.sc-item:hover .sc-more,.sc-item:focus-within .sc-more{opacity:1}
@media (hover:none){.sc-more{opacity:.65}}
.sc-more:hover{background:rgba(var(--fg-rgb),.1);color:var(--fg)}
.sc-menu{position:absolute;top:calc(100% - 4px);right:6px;z-index:5;min-width:168px;padding:5px;border-radius:14px;
  background:var(--card-solid);border:1px solid var(--line-strong);box-shadow:0 16px 40px rgba(0,0,0,.35);display:grid}
.sc-mi{display:flex;align-items:center;gap:8px;width:100%;padding:9px 10px;border:0;border-radius:9px;background:transparent;
  color:var(--fg);font-size:14px;font-weight:500;text-align:left;cursor:pointer}
.sc-mi:hover{background:rgba(var(--fg-rgb),.08)}
.sc-mi.is-danger{color:var(--danger)}
.sc-mi.is-armed{background:rgba(255,138,122,.14);color:var(--danger)}
.sc-note{padding:8px 12px;font-size:13.5px;color:var(--muted);line-height:1.45}
.sc-signin{margin:2px 6px 0;padding:12px;border-radius:14px;border:1px solid var(--line-soft);background:rgba(var(--fg-rgb),.04)}
.sc-signin p{font-size:13.5px;color:var(--muted);line-height:1.45;margin-bottom:9px}
.drawer-foot-btn>span{display:flex;align-items:center;justify-content:center}
.drawer-foot-btn>span svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
.drawer-foot2{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 6px 2px;margin-top:auto}
.drawer-foot2 .drawer-model{width:100%}

/* ---------- Pinned bottom bar ---------- */
.drawer-bar{flex:none;display:flex;align-items:center;gap:10px;
  padding:10px calc(var(--safe-r) + 14px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 14px);
  border-top:1px solid var(--line-soft);background:rgba(var(--glass-rgb),.6)}
.drawer-bar-btn{width:45px;height:45px;flex:none;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:rgba(var(--fg-rgb),.06);border:1px solid var(--line);color:var(--fg);cursor:pointer;
  transition:background-color .18s var(--ease-out),transform .12s var(--ease-out);-webkit-tap-highlight-color:transparent}
.drawer-bar-btn:hover{background:rgba(var(--fg-rgb),.11)}
.drawer-bar-btn:active{transform:scale(.94)}
.drawer-bar-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.drawer-search{flex:1;min-width:0;display:flex;align-items:center;gap:9px;height:45px;border-radius:99px;padding:0 15px;
  background:rgba(var(--fg-rgb),.06);border:1px solid var(--line);transition:border-color .18s}
.drawer-search>svg{width:19px;height:19px;flex:none;color:var(--muted-2);fill:none;stroke:currentColor;
  stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.drawer-search:focus-within{border-color:var(--line-strong)}
.drawer-search input{flex:1;min-width:0;background:transparent;border:0;outline:0;color:var(--fg);font-size:15px;font-family:inherit}
.drawer-search input::placeholder{color:var(--muted-2)}

/* ---------- Settings: plan card ---------- */
#settingsSheet .sheet-title{font-size:22px;font-weight:800;letter-spacing:-.02em}
.set-plan{margin-top:14px;padding:16px 17px 13px;border-radius:22px;background:rgba(var(--fg-rgb),.05);
  border:1px solid var(--line-soft)}
.set-plan-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.set-plan-name{font-size:17px;font-weight:650;color:var(--fg)}
.set-plan-meta{font-size:12.5px;color:var(--muted);text-align:right;white-space:nowrap}
.set-plan-reset{margin-top:2px;font-size:13px;color:var(--muted)}
.set-plan-bar{margin-top:11px;height:8px;border-radius:99px;background:rgba(var(--fg-rgb),.13);overflow:hidden}
.set-plan-fill{height:100%;width:0;border-radius:99px;background:var(--gold);transition:width .5s var(--ease-out)}
.set-plan-fill.is-high{background:var(--danger)}
.set-plan-manage{display:inline-block;margin-top:12px;padding-top:11px;border-top:1px solid var(--line-soft);
  width:100%;font-size:15px;font-weight:550;color:var(--gold);text-decoration:none}
.set-plan-note{margin-top:11px;font-size:13px;color:var(--muted)}

/* ---------- Settings: grouped row cards ---------- */
.set-card{margin-top:14px;border-radius:22px;background:rgba(var(--fg-rgb),.05);border:1px solid var(--line-soft);overflow:hidden}
.set-rowbtn{display:flex;align-items:center;gap:13px;width:100%;min-height:53px;padding:6px 16px;border:0;
  background:transparent;color:var(--fg);font-size:16px;font-weight:500;text-align:left;cursor:pointer;
  -webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-out)}
.set-rowbtn:hover{background:rgba(var(--fg-rgb),.05)}
.set-card .set-rowbtn + .set-rowbtn{border-top:1px solid var(--line-soft)}
.set-ic{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:none;color:var(--muted-2)}
.set-ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.set-rowlabel{flex:1;min-width:0}
.set-rowsub{display:block;font-size:12.5px;color:var(--muted);font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.set-chev{flex:none;color:var(--muted-2);display:flex}
.set-chev svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.set-acct-label{margin:20px 4px -6px;font-size:13px;color:var(--muted)}
.set-logout{color:var(--danger);font-weight:550}
.set-version{margin-top:22px;text-align:center;font-size:12.5px;color:var(--muted-2)}

/* ---------- Settings: sub-pages ---------- */
.set-page{border-top:0;padding:0;display:block}
.set-page[hidden]{display:none}
#setMain[hidden]{display:none}
.set-back{display:flex;align-items:center;gap:5px;margin:2px 0 12px;padding:7px 12px 7px 8px;border:0;border-radius:99px;
  background:rgba(var(--fg-rgb),.06);color:var(--fg);font-size:14px;font-weight:600;cursor:pointer}
.set-back svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.set-page .set-title{font-size:20px;font-weight:750;letter-spacing:-.01em;text-transform:none;color:var(--fg);margin-bottom:8px}
.set-page .set-group{border-top:0}
.set-links{display:grid;gap:8px;margin-top:4px}
.set-linkrow{display:flex;align-items:center;gap:13px;min-height:50px;padding:6px 14px;border-radius:16px;
  background:rgba(var(--fg-rgb),.05);border:1px solid var(--line-soft);color:var(--fg);font-size:15.5px;font-weight:500;text-decoration:none}
.set-linkrow:hover{background:rgba(var(--fg-rgb),.09)}

/* ---------- Duo: pinned sidebar (responsive-duo SPEC Step 2) ---------- */
@media (min-width:1024px){
  body.duo .drawer-panel{overflow:hidden}        /* keep .drawer-scroll/.drawer-bar split, as in overlay mode */
  body.duo .drawer-nav>li{animation:none}        /* rows are permanent; kill the staggered entrance */
}

/* BEGIN duo-navhide (2026-11-04): collapse the pinned duo sidebar from the
   "Hide sidebar" button inside the menu; the topbar menu button returns to
   bring it back, and wide views widen into the freed space. Layout only. */
.duo-hide-btn{display:none!important}
@media (min-width:1024px){
  body.duo .duo-hide-btn{display:inline-flex!important}
  body.duo.navhidden #drawer{display:none!important}
  body.duo.navhidden .app{padding-left:0!important}
  body.duo.navhidden #topbar #menuBtn{display:inline-flex!important}
  body.duo.navhidden{--col-wide:1360px}
}
/* END duo-navhide */

/* BEGIN duo-rail (2026-11-04): Liquid Glass floating pane controls — a
   vertical glass pill at the right edge of the content; it rides the right
   panel's edge (right:332px while the panel is docked, 12px once hidden)
   and body.rp-hidden reclaims the panel's 320px gutter so the screen is
   flush edge to edge. */
.duo-rail{display:none}
.duo-rail button{width:40px;height:40px;border-radius:50%;border:1px solid transparent;background:transparent;color:var(--fg);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.duo-rail button:hover{background:rgba(var(--fg-rgb),.10)}
.duo-rail button:active{transform:scale(.94)}
.duo-rail button[aria-pressed="true"]{background:rgba(var(--fg-rgb),.14);border-color:var(--line-strong)}
.duo-rail svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media (min-width:1024px){
  body.duo .duo-rail{position:fixed;right:12px;top:50%;transform:translateY(-50%);z-index:950;display:flex;flex-direction:column;gap:6px;padding:8px 6px;border-radius:999px;background:rgba(var(--glass-rgb),.55);border:1px solid var(--line-strong);-webkit-backdrop-filter:blur(20px) saturate(160%);backdrop-filter:blur(20px) saturate(160%);box-shadow:0 12px 32px rgba(0,0,0,.35),inset 0 1px 0 rgba(var(--fg-rgb),.18);transition:right .35s cubic-bezier(.16,1,.3,1)}
  body.duo:not(.rp-hidden) .duo-rail{right:332px}
  body.duo.rp-hidden #vai-panel{transform:translateX(105%)!important}
  body.duo.rp-hidden{padding-right:0!important}
  body.kid-locked .duo-rail,body.show-auth .duo-rail{display:none!important}
}
/* END duo-rail */

/* BEGIN invite-btn + music-chooser (2026-11-04): the gold panel button is
   replaced by an Invite button in the same topbar slot; the chooser card
   is js/musiccmd.js's "which song?" picker. */
#vai-panel-topbtn{display:none!important}
.vai-invite-btn{margin-left:auto;display:inline-flex;align-items:center;gap:7px;height:44px;padding:0 16px;border-radius:999px;border:1.5px solid rgba(227,183,122,.7);background:rgba(var(--fg-rgb),.16);color:var(--fg);font-size:14px;font-weight:650;cursor:pointer;flex-shrink:0;box-shadow:0 8px 24px #00000059,0 0 18px #e3b77a40,inset 0 1px rgba(var(--fg-rgb),.22)}
.vai-invite-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.vai-invite-btn:active{transform:scale(.96)}
/* Invite in light theme = the neighbouring round buttons' treatment (solid
   white pill, dark glyph) so it stays readable there too (2026-11-07). */
[data-theme=light] .vai-invite-btn{background:#fff;border-color:#8a5a1299;box-shadow:0 8px 22px #3c325a2e,0 0 0 4px #8a5a1214}
.duo-rail-sep{display:block;height:1px;width:24px;margin:4px auto;background:var(--line-strong)}
.music-chooser{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--comp-live, var(--comp-h, 84px)) + 16px);z-index:960;width:min(420px,calc(100vw - 24px));display:grid;gap:6px;padding:12px;border-radius:18px;background:rgba(var(--glass-rgb),.72);border:1px solid var(--line-strong);-webkit-backdrop-filter:blur(20px) saturate(160%);backdrop-filter:blur(20px) saturate(160%);box-shadow:0 16px 40px rgba(0,0,0,.4)}
.music-chooser-head{display:flex;align-items:center;justify-content:space-between;padding:2px 4px 6px;font-size:14px;color:var(--fg)}
.music-chooser-x{width:28px;height:28px;border-radius:99px;border:1px solid var(--line-strong);background:transparent;color:var(--fg);font-size:16px;line-height:1;cursor:pointer}
.music-chooser-item{text-align:left;padding:11px 12px;border-radius:12px;border:1px solid var(--line);background:rgba(var(--fg-rgb),.05);color:var(--fg);font-size:14px;font-weight:600;cursor:pointer}
.music-chooser-item:hover{background:rgba(var(--fg-rgb),.10)}
/* END invite-btn + music-chooser */

/* BEGIN duo-menubtn (2026-11-04): Muse-style pane toggle — the topbar menu
   button stays visible in duo and toggles the sidebar both ways. */
@media (min-width:1024px){
  body.duo:not(.show-auth):not(.kid-locked) #topbar #menuBtn{display:inline-flex!important}
}
/* END duo-menubtn */

/* BEGIN no-hero-tune (2026-11-04, Kelvin's order): remove the sliders
   "Personalize" button that sat beside the Vision AI status pill up top.
   Personalize itself stays in the menu footer and the side panel. */
#agentTune{display:none!important}
/* END no-hero-tune */

/* BEGIN traders-fullwidth (2026-11-04): the Traders view goes full width in
   duo — no column cap — so the chart gets the whole screen like TradingView. */
@media (min-width:1024px){
  body.duo #view-traders{max-width:none}
}
/* END traders-fullwidth */

/* VA GLASS MENUS 2026-11-05 — left drawer: the living background (starfield +
   VA lattice) seen THROUGH the menu, Liquid Glass language. Dark default only:
   every surface uses the dark theme's glass tokens (--glass-rgb = 24,25,38),
   and each rule is re-pinned under [data-theme=light] below so light menus
   keep their cream surfaces untouched. Background/backdrop-filter/border only —
   no layout, size, position or z-index changes. */
/* Drawer root: opaque #15161f (styles.css) -> translucent dark glass + blur */
.drawer-panel{background:linear-gradient(180deg,rgba(96,64,190,.12),rgba(var(--glass-rgb),.15) 55%,rgba(var(--glass-rgb),.19))!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;border-right-color:rgba(var(--fg-rgb),.22)}
/* Inner surfaces one step more solid than the root so text stays crisp:
   settings plan/group cards (.05 fg tint is near-clear once the root is glass) */
.set-plan,.set-card{background:rgba(var(--glass-rgb),.45)}
.set-linkrow,.sc-signin{background:rgba(var(--glass-rgb),.30)}
/* Popover menu already uses the solid token — soften one step, keep readable */
.sc-menu{background:rgba(var(--glass-rgb),.8)}
/* Pinned bottom bar (.6 glass today) — one step lighter, keep the hairline */
.drawer-bar{background:rgba(var(--glass-rgb),.35)}
/* Light theme: re-pin the original surfaces exactly (transparency is dark-only) */
[data-theme=light] .drawer-panel{background:#fbf9f4!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;border-right-color:var(--line-strong)}
[data-theme=light] .set-plan,[data-theme=light] .set-card{background:rgba(var(--fg-rgb),.05)}
[data-theme=light] .set-linkrow,[data-theme=light] .sc-signin{background:rgba(var(--fg-rgb),.05)}
[data-theme=light] .sc-menu{background:var(--card-solid)}
[data-theme=light] .drawer-bar{background:rgba(var(--glass-rgb),.6)}
/* END VA GLASS MENUS 2026-11-05 */
