/* Neutral sidebar from the approved reference; navigation behavior stays in app.js. */
:root[data-theme] .app-shell[data-sidebar-pinned]{--sidebar-expanded:296px}
:root[data-theme] .sidebar.sidebar-menu{
  --nav-bg:#fff;--nav-ink:#202635;--nav-line:#dfe2e7;--nav-hover:#f5f7f7;--nav-active:#eef4f4;--nav-focus:#0c6971;
  --menu-muted:#6e7581;--menu-accent:#105c63;--menu-count-bg:#edf7f8;--menu-count-line:#afd4d7;--menu-count-ink:#0d6872;
  background:var(--nav-bg);color:var(--nav-ink);border-color:var(--nav-line);
}
:root[data-theme=dark] .sidebar.sidebar-menu{
  --nav-bg:#202628;--nav-ink:#e5e9ed;--nav-line:#3b4349;--nav-hover:#2a3236;--nav-active:#293c40;--nav-focus:#86d3d8;
  --menu-muted:#a7afb9;--menu-accent:#99dce0;--menu-count-bg:#243e43;--menu-count-line:#527f85;--menu-count-ink:#b3e3e7;
}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-scroll{padding:0;gap:0;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--nav-line) transparent}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand{min-height:76px;padding:18px 50px 18px 20px;gap:14px;border-bottom:1px solid var(--nav-line);font:700 22px/1.2 Georgia,'Times New Roman',serif;letter-spacing:-.3px;color:var(--nav-ink)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand>.icon{width:30px;height:32px;flex:none;padding:0;border-radius:0;background:transparent;color:var(--nav-ink);stroke-width:1.7}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand>span{max-width:190px}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-pin{top:23px;right:12px;width:30px;height:30px;padding:0;border:0;border-radius:var(--radius-control,6px);background:transparent;color:var(--nav-ink)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-pin>.icon{width:23px;height:23px}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-pin[aria-pressed=true]{background:transparent;color:var(--menu-accent)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-pin:hover{background:var(--nav-hover)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-primary{display:flex;flex-direction:column;gap:0;flex:0 0 auto;min-height:auto;overflow:visible;margin:0;padding:0}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav-section{display:flex;flex-direction:column;gap:0;min-width:0;padding:14px 0}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav-section+.nav-section{border-top:1px solid var(--nav-line)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav-section-title{margin:0 20px 10px;padding:0;color:var(--menu-muted);font:650 11px/18px Inter,Arial,sans-serif;letter-spacing:1.1px;text-transform:uppercase;white-space:nowrap}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:15px;min-height:44px;padding:9px 20px 9px 17px;border:0;border-inline-start:3px solid transparent;border-radius:0;font-size:15px;line-height:1.4;font-weight:400;color:var(--nav-ink);white-space:nowrap;text-align:left}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button>.icon{width:24px;height:24px;flex:none;padding:0;border-radius:0;background:transparent;color:currentColor;stroke-width:1.7}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button:hover{background:var(--nav-hover);color:var(--nav-ink)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button.active{background:var(--nav-active);border-inline-start-color:var(--menu-accent);color:var(--menu-accent);font-weight:500}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button.active>.icon{background:transparent;color:currentColor}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav .nav-illustrated-icon{display:none}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav .nav-outline-icon{display:block}
/* Discreet topic colors on counters, as requested after the neutral menu reference. */
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button>.nav-badge{position:static;inset:auto;display:inline-flex;align-items:center;justify-content:center;flex:none;width:26px;height:26px;min-width:26px;min-height:26px;max-width:none;aspect-ratio:1;margin:0 0 0 auto;padding:0;border:1px solid var(--menu-count-line);border-radius:var(--radius-circle,50%);background:var(--menu-count-bg);color:var(--menu-count-ink);box-shadow:none;font-size:10px;line-height:1;font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:0;text-align:center}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-bottom{flex-shrink:0;margin:0;padding:10px 0;border-top:1px solid var(--nav-line)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-bottom .nav{display:flex;flex-direction:column;gap:0}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-theme{position:relative;display:flex;align-items:center;gap:15px;min-height:44px;margin:0;padding:9px 20px;border:0;border-radius:0;font-size:15px;line-height:1.4;color:var(--nav-ink)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-theme>.icon{width:24px;height:24px;flex:none;color:currentColor;stroke-width:1.7}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-theme-switch{position:relative;display:block;flex:none;width:38px;height:22px;max-width:none;margin-left:auto;border-radius:var(--radius-dialog,12px);background:#d4d8de;opacity:1;visibility:visible}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-theme-switch:before{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:var(--radius-circle,50%);background:#fff;box-shadow:0 1px 2px #14203520;transition:transform .15s ease}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-theme[aria-checked=true] .sidebar-theme-switch{background:var(--menu-accent)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .sidebar-theme[aria-checked=true] .sidebar-theme-switch:before{transform:translateX(16px)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile{display:flex;align-items:center;justify-content:flex-start;flex-shrink:0;gap:12px;min-height:64px;margin:auto 0 0;padding:14px 20px;border-top:1px solid var(--nav-line);color:var(--nav-ink)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile>.sidebar-avatar{display:grid;place-items:center;flex:none;max-width:none;width:32px;height:32px;border-radius:var(--radius-circle,50%);background:var(--nav-active);color:var(--menu-accent);font-size:12px;font-weight:600;opacity:1;visibility:visible}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile button{display:grid;place-items:center;flex:none;width:36px;min-width:36px;height:36px;min-height:36px;margin-left:auto;padding:7px;border-radius:var(--radius-control,6px);color:var(--nav-ink)}
:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile button:hover{background:var(--nav-hover)}
@media(min-width:701px){
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .brand{padding-left:calc((var(--sidebar-rail) - 30px)/2);padding-right:calc((var(--sidebar-rail) - 30px)/2);gap:0}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .sidebar-pin{top:24px;right:-10px;width:26px;height:28px;background:var(--nav-bg);border:1px solid var(--nav-line)}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .nav-section-title{visibility:hidden}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .nav button{justify-content:center;gap:0;padding-left:0;padding-right:3px}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .nav button>.nav-badge{position:absolute;top:2px;right:20px;left:auto;bottom:auto;width:20px;height:20px;min-width:20px;min-height:20px;margin:0;font-size:8px}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .sidebar-theme{justify-content:center;gap:0;padding-inline:0}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .sidebar-theme-switch{display:none}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .profile{padding-left:0;padding-right:0;gap:0}
  :root[data-theme] .app-shell[data-sidebar-pinned=false] .sidebar-menu:not(:hover):not(:has(:focus-visible)) .profile>span{display:none}
  /* Keep the session action's hit area stable while the rail expands. */
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile{position:relative;padding-left:calc(var(--sidebar-rail) + 12px);flex-wrap:nowrap}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile button{position:absolute;left:calc((var(--sidebar-rail) - 36px)/2);top:50%;transform:translateY(-50%);margin-left:0}
}
@media(max-width:700px){
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand{padding-left:20px;padding-right:50px;font-size:22px}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand>span,:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button>span,:root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile>.sidebar-profile-name{display:block;opacity:1;visibility:visible;max-width:none}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button{min-height:46px}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .profile{padding-left:20px}
}
@media(max-width:360px){
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand{padding-left:16px;font-size:20px;gap:12px}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .brand>.icon{width:26px;height:28px}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav button{padding-left:13px;padding-right:16px;gap:12px}
  :root[data-theme] .app-shell[data-sidebar-pinned] .sidebar-menu .nav-section-title{margin-inline:16px}
}
@media(prefers-reduced-motion:reduce){:root[data-theme] .sidebar-menu .sidebar-theme-switch:before{transition:none}}

:root[data-theme] .sidebar-menu .nav button:focus-visible{outline-offset:-3px}

:root[data-theme] .sidebar-menu .profile button>.icon{width:24px;height:24px}

:root[data-theme] .sidebar-menu .nav button[data-view=mail]>.nav-badge{--menu-count-bg:#f3edf9;--menu-count-line:#d1bfe8;--menu-count-ink:#7045a5}
:root[data-theme] .sidebar-menu .nav button[data-view=inbox]>.nav-badge{--menu-count-bg:#fff4df;--menu-count-line:#e7cb9b;--menu-count-ink:#98660d}
:root[data-theme=dark] .sidebar-menu .nav button[data-view=mail]>.nav-badge{--menu-count-bg:#3b3149;--menu-count-line:#76608b;--menu-count-ink:#d7bdf3}
:root[data-theme=dark] .sidebar-menu .nav button[data-view=inbox]>.nav-badge{--menu-count-bg:#473c2a;--menu-count-line:#93764b;--menu-count-ink:#efcf96}
