/* Signed-in navigation: two actions, three main links, then the bottom widget (the workspace half and its
   menu, the network half whose menu lists the networks, then the workspace's wallets) and the person's own
   row under it.
   One file for the sidebar; loaded after layout.css so it wins over the older shell rules in app.css.
   On a wide screen it is a 224px rail; at 960px and below a compact top bar opens the same content as a
   drawer. The active link's ink bar lives in motion.css. */

.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* Chevrons are one SVG (partials/chevron.html), centred on the line box instead of a text glyph sitting on the baseline. */
.chev { display:inline-flex; align-items:center; justify-content:center; flex:none; line-height:0; }
.chev-icon { display:block; }
.chev-icon.up { transform:rotate(180deg); }

/* ── Rail ─────────────────────────────────────────────────────────────────────────────────────────── */
/* The sticky rail is its own stacking context; z-index lifts its wider menus over the page. */
.side { z-index:30; gap:0; padding:22px 12px 12px; overflow:visible; }
.side-top { display:none; }
.side-panel { display:flex; flex-direction:column; flex:1; min-height:0; }
.side .brand { margin:0 0 22px; }
.side-actions { display:flex; flex-direction:column; gap:8px; margin:0 0 18px; }
.side-actions .btn { width:100%; height:36px; margin:0; justify-content:center; }
.side-actions .btn.ghost { background:var(--white); }
.viewer-note { margin:0 0 16px; padding:10px 12px; border-radius:10px; background:var(--white); box-shadow:inset 0 0 0 1px var(--line-soft); font:400 12px/1.45 var(--font-b); color:var(--mute); }
.viewer-note strong { display:block; color:var(--ink); font:600 12.5px/1.3 var(--font-b); margin-bottom:3px; }
.viewer-note p { margin:0; }
.viewer-note a { display:inline-flex; align-items:center; min-height:32px; color:var(--ink); font-weight:500; }

.side .sidenav { display:flex; flex-direction:column; gap:2px; }
.side .sidenav a { position:relative; display:flex; align-items:center; gap:8px; height:34px; padding:0 10px 0 14px; border-radius:8px; background:none; box-shadow:none; color:var(--mute); font:500 13.5px/1 var(--font-b); text-decoration:none; }
.side .sidenav a:hover { color:var(--ink); }
.side .sidenav a[aria-current] { color:var(--ink); font-weight:600; }
.side .sidenav .pill { margin-left:auto; min-width:20px; padding:2px 6px; border-radius:10px; background:var(--white); text-align:center; font:600 11px/1.3 var(--font-b); }
/* The Your GEN badge's popover (app.css .tooltip): one link per counted notice, beside the rail. Hovering the badge
   or keyboard focus inside opens it; closing waits a moment so the pointer can cross the gap (bridged by ::before).
   Closed, it is clipped to nothing the .sr-only way, so its links stay in the tab order and the accessibility tree
   and focusing one opens it. Escape closes it until the pointer or focus leaves (sidebar.js). */
.side .sidenav .side-attn { position:relative; }
.side .sidenav .side-tip { display:block; left:calc(100% + 8px); top:0; padding:4px; pointer-events:auto; animation:none;
  opacity:0; clip-path:inset(50%); transition:opacity 120ms var(--ease, ease) 200ms, clip-path 0s linear 320ms; }
.side .sidenav .side-tip::before { content:""; position:absolute; right:100%; top:0; bottom:0; width:24px; }
.side-attn:has(.pill:hover) .side-tip, .side .sidenav .side-tip:hover, .side-attn:has(:focus-visible) .side-tip {
  opacity:1; clip-path:inset(-24px -24px -24px -40px); transition-delay:0s; }
.side .sidenav .side-attn[data-dismissed] .side-tip { opacity:0; clip-path:inset(50%); transition:none; }
.side .sidenav .side-tip ul { list-style:none; margin:0; padding:0; }
.side .sidenav .side-tip a { display:block; height:auto; padding:3px 8px; border-radius:6px; color:var(--ink); font:400 12px/1.5 var(--font-b); text-decoration:none; }
.side .sidenav .side-tip a:hover, .side .sidenav .side-tip a:focus-visible { background:var(--fog); }
.side .sidenav .side-tip-more a { color:var(--mute); }
.side .side-spacer { display:block; flex:1; min-height:24px; }

/* ── The bottom widget ─────────────────────────────────────────────────────────────────────────────── */
.side-widget { position:relative; border:1px solid var(--line); border-radius:var(--r-card); background:var(--white); color:var(--ink); }
.sw-trigger { display:flex; align-items:center; gap:9px; width:100%; min-height:44px; margin:0; padding:9px 12px; border:0; border-radius:calc(var(--r-card) - 1px); background:none; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.sw-trigger:hover, .sw-trigger[aria-expanded="true"] { background:var(--fog); }
.sw-trigger .chev-icon { color:var(--mute); transition:transform 160ms var(--ease, ease); }
.sw-trigger[aria-expanded="true"] .chev-icon.up { transform:none; }
.sw-name { flex:1; min-width:0; line-height:1.3; }
.sw-name strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 13px/1.35 var(--font-b); }
.sw-name small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:500 11.5px/1.35 var(--font-b); color:var(--mute); }
.sw-name .plan-tag { color:var(--control); }
.sw-address { font-family:var(--font-m) !important; font-size:10.5px !important; letter-spacing:-.01em; }
.sw-org:has(+ .sw-net) > .sw-trigger { border-radius:calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0 0; }
.sw-net { border-top:1px solid var(--line-soft); }
.sw-net > .sw-trigger { border-radius:0 0 calc(var(--r-card) - 1px) calc(var(--r-card) - 1px); }

/* The menus rise from the widget and may be wider than the 224px rail. */
.sw-menu { position:absolute; left:0; bottom:calc(100% + 6px); z-index:40; width:288px; max-height:calc(100dvh - 96px); overflow-y:auto; padding:6px; background:var(--white); border:1px solid var(--line); border-radius:var(--r-card); box-shadow:0 12px 32px rgb(30 24 12 / .12); }
:root[data-theme="dark"] .sw-menu { background:var(--fog); box-shadow:0 12px 32px rgb(0 0 0 / .45); }
.sw-menu[hidden] { display:none; }
.sw-menu ul { list-style:none; margin:0; padding:0; }
.sw-menu nav { display:flex; flex-direction:column; }
.sw-menu a, .sw-menu .account-signout button { display:flex; align-items:center; justify-content:space-between; gap:9px; width:100%; min-height:34px; margin:0; padding:7px 10px; border:0; border-radius:8px; background:none; color:var(--ink); font:500 13px/1.35 var(--font-b); text-align:left; text-decoration:none; cursor:pointer; }
.sw-menu a:hover, .sw-menu .account-signout button:hover, .sw-menu a[aria-current] { background:color-mix(in srgb,var(--ink) 5%,transparent); }
.sw-menu hr { border:0; border-top:1px solid var(--line-soft); margin:12px 0; }  /* 24px between groups */
.sw-group, .sw-menu .ws-group { margin:8px 10px 4px; font:500 11.5px/1.3 var(--font-b); letter-spacing:0; text-transform:none; color:var(--mute); }
.sw-menu .sw-group:first-child, .sw-workspaces > .sw-group:first-child { margin-top:4px; }
.sw-entry { flex:1; min-width:0; }
.sw-entry strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 13px/1.35 var(--font-b); }
.sw-entry small { display:flex; align-items:center; gap:6px; font:500 11px/1.35 var(--font-b); color:var(--mute); }
.sw-check { flex:none; color:var(--ink); }
.sw-empty { margin:6px 10px; font:400 12px/1.4 var(--font-b); color:var(--mute); }
.sw-workspaces { max-height:min(320px, calc(100dvh - 380px)); min-height:96px; overflow-y:auto; }
.sw-ident { margin:4px 10px 4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:500 12px/1.4 var(--font-b); color:var(--mute); }
.sw-entry-name { display:flex; align-items:center; gap:6px; min-width:0; }
.sw-entry-name strong { min-width:0; }
.sw-tag { flex:none; padding:1px 6px; border:1px solid var(--line); border-radius:999px; font:500 10.5px/1.3 var(--font-b); color:var(--mute); }
/* The directory closes the workspace list as its footer. */
.sw-menu a.sw-foot { min-height:32px; margin-top:2px; color:var(--mute); font-size:12.5px; }
.sw-menu a.sw-foot:hover { color:var(--ink); }

/* ── The person's row, under the card ──────────────────────────────────────────────────────────────── */
.side-you { position:relative; margin-top:6px; }
.you-trigger { display:flex; align-items:center; gap:9px; width:100%; min-height:38px; margin:0; padding:5px 8px 5px 6px; border:0; border-radius:10px; background:none; color:var(--ink); font:500 12.5px/1.3 var(--font-b); text-align:left; cursor:pointer; }
.you-trigger:hover, .you-trigger[aria-expanded="true"] { background:color-mix(in srgb,var(--ink) 5%,transparent); }
/* A filled ink disc: the person, not another context card. */
.you-avatar { display:inline-grid; place-items:center; width:28px; height:28px; flex:none; border-radius:50%; background:var(--ink); font:600 10.5px/1 var(--font-b); letter-spacing:.02em; color:var(--white); }
.you-name { flex:1; min-width:0; }
.you-name strong, .you-name small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.you-name strong { font:600 12.5px/1.3 var(--font-b); }
.you-name small { font:400 11px/1.3 var(--font-b); color:var(--mute); }
.you-more { flex:none; color:var(--mute); }
.you-theme { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 4px 4px 10px; font:500 13px/1.35 var(--font-b); color:var(--ink); }
.you-theme-set { display:inline-flex; gap:2px; padding:2px; border:1px solid var(--line); border-radius:8px; background:var(--fog); }
.you-theme-set button { display:inline-grid; place-items:center; width:28px; height:24px; margin:0; padding:0; border:0; border-radius:6px; background:none; color:var(--mute); cursor:pointer; }
.you-theme-set button:hover { color:var(--ink); }
.you-theme-set button[aria-pressed="true"] { background:var(--white); color:var(--ink); box-shadow:0 1px 2px rgb(0 0 0 / .08); }
:root[data-theme="dark"] .you-theme-set { background:var(--canvas, var(--fog)); }
:root[data-theme="dark"] .you-theme-set button[aria-pressed="true"] { background:var(--fog); }
.account-signout { margin:0; }
/* The network menu's network list (partials/network_list.html, shared with the public header). */
.sw-menu .network-list { display:block; max-height:none; overflow:visible; }
.sw-menu .network-list .ws-group:first-child { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.sw-menu .network-list strong { font:500 13px/1.35 var(--font-b); }
.sw-menu .network-list small { display:none; }
.sw-menu .network-list small.net-kind { display:block; }  /* a testnet always says so */
.network-soon:has(.net-kind) { flex-direction:column; align-items:flex-start; justify-content:center; }
.network-soon { display:flex; align-items:center; min-height:34px; padding:6px 10px; color:var(--mute); font:400 13px/1.4 var(--font-b); cursor:default; }
.network-soon strong { font-weight:400; color:inherit; }

/* ── The public header's network menu ──────────────────────────────────────────────────────────────── */
.network-selector .net-k { font:500 12px/1 var(--font-b); color:var(--mute); }
.network-selector .chev { color:var(--mute); }
.network-selector { position:relative; margin:0; font:500 12px/1.3 var(--font-b); }
.network-selector > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:6px; min-height:34px; padding:6px 10px; border:1px solid var(--line); border-radius:999px; background:var(--white); color:var(--ink); }
.network-selector > summary::-webkit-details-marker { display:none; }
.network-selector > summary:hover, .network-selector[open] > summary { background:var(--fog); }
.network-selector .net-v { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.network-selector[open] .chev { transform:rotate(180deg); }
.network-selector.is-closing .chev { transform:none; }
.network-options { padding:6px; }
.network-options .network-list { display:block; max-height:min(320px, calc(100dvh - 200px)); overflow-y:auto; }  /* display: .public-header nav is flex (entry.css:5) */
.network-list ul { list-style:none; margin:0; padding:0; }
.network-list .ws-group:first-child { margin-top:4px; }
.network-list small { display:block; margin-top:2px; font:400 11px/1.4 var(--font-b); color:var(--mute); }
.network-options a { min-height:34px; }
.public-header .network-options { right:auto; width:260px; max-width:calc(100vw - 40px); }
/* Narrow headers wrap, so the selector can sit at either edge of a row: the menu then spans the header
   under its summary (its static top) instead of hanging off the selector's left edge past the screen. */
@media (max-width:700px) {
  .public-header { position:relative; }
  .public-header .network-selector { position:static; }
  .public-header .network-options { top:auto; left:16px; right:16px; width:auto; max-width:none; margin-top:6px; }
}
/* motion.js animates these menus itself; the generic details[open] rise (entry.css) would run twice. */
details[data-menu] > summary + * { animation:none; }

/* ── Phone and tablet: a compact top bar; the menu button opens the same content as a drawer ───────── */
@media (max-width: 960px) {
  .side { position:sticky; top:0; z-index:40; display:block; width:auto; height:auto; padding:0; border-right:0; border-bottom:1px solid var(--line); background:var(--fog); }
  /* Tall enough for the full public-header lockup, wordmark over byline (entry.css .public-brand). */
  .side-top { position:relative; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:12px; height:64px; padding:0 16px; background:var(--fog); }
  .side-toggle { position:relative; display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 14px; border:1px solid var(--line); border-radius:999px; background:var(--white); color:var(--ink); font:600 13px/1 var(--font-b); cursor:pointer; }
  .side-toggle-dot { position:absolute; top:6px; right:8px; width:7px; height:7px; border-radius:50%; background:var(--crit); }
  .side-panel { display:none; position:absolute; top:100%; left:0; right:0; z-index:1; max-height:calc(100dvh - 64px); overflow-y:auto; overscroll-behavior:contain; padding:12px 16px 16px; background:var(--fog); border-bottom:1px solid var(--line); }
  .side.is-open .side-panel { display:flex; gap:12px; }
  /* The scrim: part of the sidebar, so a tap on it closes the drawer instead of reaching the page. */
  .side.is-open::after { content:""; position:fixed; inset:0; z-index:-1; background:rgb(19 18 20 / .32); }
  .side-panel .brand { display:none; }
  .side-actions { flex-direction:row; margin:0; }
  .side-actions .btn { flex:1; width:auto; height:44px; }
  .viewer-note { margin:0; }
  .side .sidenav a { height:44px; font-size:15px; }
  .side .sidenav .side-tip { display:none; }  /* no hover in the drawer: the badge stays and Your GEN lists the notices */
  .side .side-spacer { display:none; }
  .sw-trigger { min-height:52px; }
  /* Inside the drawer the menus open in place under their half. */
  .sw-menu { position:static; width:auto; max-height:none; margin:0 6px 8px; box-shadow:none; border-color:var(--line-soft); }
  .sw-workspaces { max-height:none; min-height:0; }
  .sw-menu a, .sw-menu .account-signout button, .network-soon { min-height:44px; }
  .sw-menu a.sw-foot { min-height:44px; }
  .side-you { margin-top:-6px; }  /* the drawer's 12px gap, less: the row belongs to the card above */
  .you-trigger { min-height:44px; }
  .you-theme-set button { width:40px; height:34px; }
  .network-options a, .network-options .network-soon { min-height:44px; }
}
@media (pointer:coarse) { .network-selector > summary { min-height:44px; } }
@media (min-width: 961px) {
  .development-banner + .shell .side { height:calc(100dvh - var(--development-banner-height, 0px)); }
}
/* A short desktop window: the rail is sticky at the window's height, so it scrolls to keep its foot (the widget
   and the account row) reachable. Its menus then open in place inside it, as in the phone drawer, rather than
   rising past the rail's edges where the scroll would clip them. */
@media (min-width: 961px) and (max-height: 680px) {
  .side { overflow-y:auto; overscroll-behavior:contain; }
  .side .sidenav .side-tip { display:none; }  /* it would sit outside the scrolling rail: the badge stays */
  .sw-menu { position:static; width:auto; max-height:none; margin:0 6px 8px; box-shadow:none; border-color:var(--line-soft); }
  .sw-workspaces { max-height:none; min-height:0; }
  .you-theme { flex-wrap:wrap; }  /* the in-place menu is the rail's width */
}

/* Explicit chevron icons in native disclosure rows follow the browser-owned state. Plain rows remain arrowless. */
details > summary[data-disclosure-row] > .chev > .chev-icon { transform:rotate(-90deg); }
details[open] > summary[data-disclosure-row] > .chev > .chev-icon { transform:none; }
