/* App shell sidebar: brand, nav sections and tree, live-match chip, foot cards, icon rail. */
.app-sidebar {
  flex: 0 0 auto;
  width: 240px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease, border-right-color 0.2s ease;
  /* Sticky on desktop; mobile @media below makes this a fixed bottom bar. */
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 50;
}
.app-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  height: 60px; /* matches .app-topbar — bottom borders align */
  padding: 0 18px;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.app-sidebar-logo {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
  /* Carries its own bronze gradient, so no currentColor theming here. */
}
.app-sidebar-brandname {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.18rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
  /* Multi-word brand wraps instead of truncating in the 240px sidebar. */
  white-space: normal;
  flex: 1 1 auto;
  min-width: 0;
}
.app-sidebar-collapse {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.app-sidebar-collapse:hover {
  background: var(--bg-hover);
  color: var(--accent-gold);
}

.app-sidebar-nav {
  /* No bottom padding: foot divider→bottom must equal --app-footer-h (see .app-sidebar-discord). */
  padding: 10px 8px 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex; flex-direction: column; gap: 4px;
}

.app-nav-section {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 0;
}
.app-nav-section + .app-nav-section {
  border-top: 1px solid var(--divider);
  margin-top: 4px;
  padding-top: 10px;
}
.app-nav-label {
  color: var(--bronze);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 4px 12px 6px;
  font-weight: 600;
}

.app-nav-item {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
}
.app-nav-item:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.app-nav-item.is-active {
  background: color-mix(in srgb, var(--accent-gold) 10%, transparent);
  color: var(--accent-gold);
  font-weight: 600;
  border-left-color: var(--accent-gold);
}
.app-nav-item-icon {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.app-nav-item-icon svg {
  width: 100%; height: 100%;
  display: block;
}
.app-nav-item-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-nav-item-ext {
  flex: 0 0 auto;
  opacity: 0.55;
  font-size: 0.78rem;
}

/* THE live-match chip: left of the topbar, so it is one reach from every screen. Sizes to its
   content and yields before the right-hand controls — the topbar is one 60px row.
   Timer driven by online-match.js writing into #app-live-timer. */
.app-live-match {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 1 auto; min-width: 0;
  /* The same box .app-topbar-quickmatch gets from .btn.btn-sm, so the two sit level in the row. */
  box-sizing: border-box;
  height: 34px;
  padding: 0 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--porphyry) 16%, transparent),
    color-mix(in srgb, var(--porphyry) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--porphyry) 55%, transparent);
  border-radius: 8px;
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--porphyry) 40%, transparent);
  transition: background 0.15s ease, border-color 0.15s ease,
              transform 0.12s ease, box-shadow 0.2s ease;
}
.app-live-match:hover {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--porphyry) 26%, transparent),
    color-mix(in srgb, var(--porphyry) 10%, transparent));
  border-color: var(--accent-red);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--porphyry) 50%, transparent);
}
.app-live-dot {
  flex: 0 0 auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--porphyry) 75%, transparent);
  animation: app-live-pulse 1.8s ease-out infinite;
}
@keyframes app-live-pulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in srgb, var(--porphyry) 65%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0   transparent; }
}
.app-live-label {
  flex: 0 0 auto;
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.app-live-timer {
  flex: 0 0 auto;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.app-live-timer:not(:empty)::before {
  /* CSS escape is `\NNNN` (no `u` prefix); `\u00B7` would render literal text. */
  content: "\00B7";
  margin-right: 4px;
  color: var(--text-muted);
  font-weight: 400;
}
/* `flex: 0 1 auto` plus the ellipsis IS "only when there is room": the name shrinks, truncates
   and finally takes no width, with no breakpoint having to guess where that happens. */
.app-live-opponent {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-live-arrow {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform 0.15s ease, color 0.15s ease;
}
/* A phone's topbar keeps the STATE: the pulse plus the clock, which says more than the word does.
   `has-clock` is set by online-match's tick — without one (an untimed board) the word stays, or
   the chip would be a bare dot. The name yields on its own. */
@media (max-width: 640px) {
  .app-live-match { gap: 6px; padding: 0 10px; }
  .app-live-arrow { display: none; }
  .app-live-match.has-clock .app-live-label { display: none; }
  .app-live-match.has-clock .app-live-timer:not(:empty)::before { content: none; }
}
.app-live-match:hover .app-live-arrow {
  transform: translateX(2px);
  color: var(--accent-red);
}

.app-sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bronze) 2%, transparent) 80%);
}
.app-sidebar-bottom .app-nav-divider { background: var(--divider); margin: 2px 6px 0; }
.app-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0 6px;
  flex: 0 0 auto;
}
.app-shell.is-collapsed .app-sidebar { width: 72px; }

.app-shell.is-collapsed .app-sidebar-brandname,
.app-shell.is-collapsed .app-sidebar-logo,
.app-shell.is-collapsed .app-nav-label,
.app-shell.is-collapsed .app-nav-item-label,
.app-shell.is-collapsed .app-nav-item-ext { display: none; }

.app-shell.is-collapsed .app-sidebar-brand {
  justify-content: center;
  padding: 0;
  /* height stays 60px so brand border remains aligned with topbar border. */
}
.app-shell.is-collapsed .app-sidebar-collapse {
  transform: scaleX(-1);
  margin: 0 auto; /* defeat expanded-layout's margin-left: auto */
  width: 32px; height: 32px;
  font-size: 0.95rem;
}
.app-shell.is-collapsed .app-sidebar-nav {
  padding-left: 4px;
  padding-right: 4px;
}
.app-shell.is-collapsed .app-nav-section {
  padding: 4px 0;
}
.app-shell.is-collapsed .app-nav-item {
  width: 48px;
  margin: 0 auto;
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  border-left: 0;
  border-radius: 8px;
}
.app-shell.is-collapsed .app-nav-item.is-active {
  border-left: 0;
  background: color-mix(in srgb, var(--accent-gold) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-gold) 50%, transparent);
}

/* On the icon rail the badge is a corner DOT, not its word: "New" at margin-left:auto stretched
   the 48px button and pushed its icon off centre. min-width guard because the shell also carries
   .is-collapsed at mobile, where the More sheet is a text row and keeps the word. The button's
   accessible name is its aria-label, so the hidden text was never announced either way. */
@media (min-width: 641px) {
  .app-shell.is-collapsed .app-nav-item { position: relative; }
  .app-shell.is-collapsed .app-nav-item-badge {
    position: absolute; top: 6px; right: 7px;
    width: 8px; height: 8px;
    margin: 0; padding: 0;
    border-radius: 999px;
    font-size: 0; line-height: 0;
  }
}

/* Hidden on desktop; mobile @media re-surfaces. */
.app-nav-item.nav-item-mobile-more { display: none; }

/* More-sheet chrome + Account group are mobile-sheet-only (avatar menu on desktop). */
.app-mobile-more-head, .app-mobile-more-foot { display: none; }
.app-nav-section[data-group="account"] { display: none; }
/* Compact bar label — only the mobile bottom bar swaps it in. */
.app-nav-item-label-s { display: none; }

.app-mobile-more-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 499; /* behind sidebar (z:500), above page */
  cursor: pointer;
  animation: app-backdrop-fade 180ms ease-out;
}
.app-shell.is-mobile-more-open .app-mobile-more-backdrop {
  display: block;
}
@keyframes app-backdrop-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes app-sheet-slide {
  from { transform: translateY(24px); }
  to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .app-mobile-more-backdrop { animation: none; }
  .app-sidebar { transition: none !important; animation: none !important; }
}

.app-nav-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: 0; cursor: pointer; font: inherit;
  color: var(--gold);
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 600;
  padding: 6px 12px;
}
.app-nav-toggle:hover .app-nav-label-text { color: var(--bronze-2); }
.app-nav-section:not(.is-collapsed) .app-nav-toggle .app-nav-caret {
  transform: rotate(90deg); color: var(--bronze-2);
}
.app-nav-label-text { flex: 0 0 auto; }

.app-nav-items { display: flex; flex-direction: column; gap: 2px; }
.app-nav-section.is-collapsed .app-nav-items { display: none; }

.app-nav-item-badge {
  flex: 0 0 auto; margin-left: auto;
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  color: #1c1610; background: var(--bronze);
}

.app-sidebar-livecount {
  display: flex; align-items: center; gap: 14px;
  width: calc(100% - 4px); margin: 0 2px; padding: 8px 10px 8px 14px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--laurel) 8%, transparent),
    color-mix(in srgb, var(--laurel) 2%, transparent));
  border: 1px solid color-mix(in srgb, var(--laurel) 22%, transparent);
  border-radius: 8px;
  cursor: pointer; color: var(--ink);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}
.app-sidebar-livecount:hover {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--laurel) 14%, transparent),
    color-mix(in srgb, var(--laurel) 4%, transparent));
  border-color: color-mix(in srgb, var(--laurel) 40%, transparent);
}
.app-sidebar-livecount:active { transform: translateY(0.5px); }
.app-sidebar-livecount-dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--laurel-2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.app-sidebar-livecount-meta { display: flex; align-items: baseline; gap: 6px; min-width: 0; line-height: 1.15; }
.app-sidebar-livecount-num {
  font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.02em; color: var(--ink);
}
.app-sidebar-livecount-label {
  font-family: var(--font-display); font-style: italic; text-transform: lowercase;
  font-size: 1rem; letter-spacing: 0.02em; color: var(--ink-2);
}

/* Height pinned so 1px line + 6px foot gap + this = var(--app-footer-h) (aligns with footer top). */
.app-sidebar-discord {
  display: flex; align-items: center; gap: 11px;
  height: calc(var(--app-footer-h, 57px) - 7px);
  width: calc(100% - 4px); margin: 0 2px; padding: 8px 10px 8px 9px;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--ink-2); text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, transform 0.12s ease;
}
.app-sidebar-discord:hover {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bronze) 10%, transparent),
    color-mix(in srgb, var(--bronze) 2%, transparent));
  border-color: color-mix(in srgb, var(--bronze) 22%, transparent);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 6px 16px rgba(0, 0, 0, 0.25);
}
.app-sidebar-discord:hover .app-sidebar-discord-ext { color: var(--bronze); transform: translateY(-1px); }
.app-sidebar-discord:active { transform: translateY(0.5px); }

/* Focus rings for shell chrome (a11y). Ring matches layout.css / buttons.css.
   overflow:hidden row families take an inset ring so it isn't clipped. */
.app-nav-item:focus-visible,
.app-nav-label:focus-visible,
.app-user-menu-item:focus-visible,
.app-sidebar-discord:focus-visible {
  outline: 2px solid var(--bronze-2); outline-offset: -2px;
}
.app-user-chip:focus-visible,
.app-sidebar-collapse:focus-visible,
.app-live-match:focus-visible,
.app-sidebar-livecount:focus-visible,
.app-focus-exit:focus-visible,
.app-notif-tab:focus-visible,
.app-notif-markall:focus-visible,
.app-notif-btn:focus-visible,
.app-mobile-more-user:focus-visible,
.app-mobile-more-x:focus-visible,
.app-mobile-more-signout:focus-visible {
  outline: 2px solid var(--bronze-2); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .app-sidebar-discord:hover,
  .app-sidebar-discord:active,
  .app-sidebar-discord:hover .app-sidebar-discord-ext { transform: none; }
}

/* Sheet-only row (shown under Account at ≤640); the desktop foot has its own Discord CTA. */
.app-mobile-more-discord-link { display: none; }
/* Discord brand colours (literal hex, not tokens). */
.app-sidebar-discord-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  background: #5865f2; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.app-sidebar-discord-ico svg { width: 18px; height: 18px; }
.app-sidebar-discord-name {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 500;
  letter-spacing: 0.01em; color: var(--chrome-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-sidebar-discord-ext {
  flex: 0 0 auto; width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  transition: color 0.16s ease, transform 0.2s ease;
}
.app-sidebar-discord-ext svg { width: 14px; height: 14px; }

/* Icon rail: ignore group collapse (always show items); center the foot cards. */
.app-shell.is-collapsed .app-nav-items { display: flex !important; }
.app-shell.is-collapsed .app-nav-toggle { display: none; }
.app-shell.is-collapsed .app-sidebar-livecount {
  width: 48px; margin: 0 auto 6px; padding: 10px 0; justify-content: center; gap: 0;
}
.app-shell.is-collapsed .app-sidebar-livecount-meta { display: none; }
.app-shell.is-collapsed .app-sidebar-discord {
  /* Height is pinned above — no vertical padding, or the 32px icon can't fit. */
  width: 48px; margin: 0 auto; padding: 0; justify-content: center; gap: 0;
}
.app-shell.is-collapsed .app-sidebar-discord-name,
.app-shell.is-collapsed .app-sidebar-discord-ext { display: none; }

/* Dissolve the items wrapper (display:contents) so nav items flatten to the bar/drawer. */
@media (max-width: 640px) {
  /* Out-rank the icon-rail's `.is-collapsed .app-nav-items` (0,3,0); the sheet's grid (0,4,0) still wins. */
  .app-shell .app-nav-section .app-nav-items { display: contents !important; }
  .app-nav-toggle { display: none; }
  .app-sidebar-livecount { display: none; }
  /* Discord lives in the sheet HEADER on mobile, so the foot CTA and the rule above it go.
     The desktop sidebar foot keeps both. */
  .app-shell .app-sidebar-discord,
  .app-shell .app-sidebar-bottom .app-nav-divider { display: none; }
  /* Header reads left-to-right like the rows under it; the caret trails on the right. */
  .app-shell.is-mobile-more-open .app-nav-label.app-nav-toggle { justify-content: flex-start; text-align: left; }
  .app-shell.is-mobile-more-open .app-nav-label-text { flex: 1 1 auto; text-align: left; }
  .app-shell.is-mobile-more-open .app-nav-caret { display: inline-flex; order: 2; margin-left: auto; }
}
/* Sidebar tab sub-nav, emitted by _navTreeHtml under the active nav item. */

/* Caret marks an item that owns tabs. U+203A, a TEXT-presentation glyph like the nav group
   group headers use; an emoji-presentation arrow would balloon the row. */
/* Sidebar nav TREE. Items that own a tree expand instead of navigating; only leaves navigate.
   The twist is a real span, not ::after, so it rotates at any depth. */
.app-nav-item.has-kids, .app-nav-subitem.has-kids { position: relative; }
.app-nav-twist {
  margin-left: auto; flex: 0 0 auto;
  font-size: 1rem; line-height: 1; color: var(--ink-3);
  transform: rotate(0deg);
  transition: transform 0.15s ease, color 0.15s ease;
}
.is-open > .app-nav-twist, .is-open .app-nav-twist:first-of-type { transform: rotate(90deg); }
.has-kids.is-open > .app-nav-twist { color: var(--bronze-2); }
.app-nav-item.has-kids:hover .app-nav-twist,
.app-nav-subitem.has-kids:hover .app-nav-twist { color: var(--ink); }

.app-nav-subgroup { display: flex; flex-direction: column; }
/* Whole tree is always in the DOM; closed branches are hidden so toggling needs no re-render. */
.app-nav-subgroup.is-collapsed { display: none; }
.app-nav-subitem {
  all: unset; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font: inherit; font-size: 0.85rem; color: var(--ink-2);
  border-left: 2px solid var(--divider);
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
/* Indent by depth so a nested branch reads as nested. */
.app-nav-subitem[data-depth="1"] { margin-left: 1.5rem; padding-left: 0.75rem; }
.app-nav-subitem[data-depth="2"] {
  margin-left: 2.5rem; padding-left: 0.75rem; font-size: 0.8rem;
  /* Third level: indent is enough. Border kept transparent so .is-active's spine still shows. */
  border-left-color: transparent;
}
.app-nav-subitem:hover { color: var(--ink); background: var(--bg-2); }
.app-nav-subitem.is-active { color: var(--bronze-2); border-left-color: var(--bronze); font-weight: 600; }
.app-nav-subitem:focus-visible { outline: 2px solid var(--bronze-2); outline-offset: -2px; }
.app-nav-subitem-count { font-size: 0.72rem; color: var(--ink-3); }

/* Icon rail cannot show text rows; the tree returns when it expands. */
/* Collapsed rail: the tree flies OUT to the right instead of widening the rail. The parent item
   is the anchor (.has-kids is position:relative), so the panel hangs off the icon it belongs to. */
/* Collapsed rail: the tree is a flyout to the right, opened by CLICKING the icon (the same
   _toggleBranch state as the expanded sidebar) — the rail keeps its width either way.
   min-width guard is required: the shell also carries .is-collapsed at mobile, where the nav is
   the bottom bar and a flyout would be nonsense. */
@media (min-width: 641px) {
  /* No overflow override needed: the panel is position:fixed, so the rail keeps its own
     clipping and, importantly, its vertical scrolling. */
  .app-shell.is-collapsed .app-nav-subgroup {
    display: flex;
    /* fixed: the panel is a SIBLING of the icon, so there is no positioned ancestor to anchor
       to — left/top are set in _toggleBranch from the icon rect. */
    position: fixed; z-index: 600;
    min-width: 12.5rem;
    margin-left: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-2);
  }
  /* Closed is closed — the click state drives it, exactly as in the expanded sidebar. */
  .app-shell.is-collapsed .app-nav-subgroup.is-collapsed { display: none; }
  /* A nested level sits inside the same panel, not a second flyout. */
  .app-shell.is-collapsed .app-nav-subgroup .app-nav-subgroup {
    position: static; left: auto; top: auto;
    min-width: 0; margin-left: 0.5rem; padding: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none;
  }
  /* Rows carry labels here; the rail hides label text on the items themselves. */
  .app-shell.is-collapsed .app-nav-subitem {
    margin-left: 0; padding: 0.375rem 0.625rem; white-space: nowrap;
  }
  /* Twists come back inside the panel — the rail hides them on the icons. */
  .app-shell.is-collapsed .app-nav-subgroup .app-nav-twist { display: inline-flex; }
}
.app-shell.is-collapsed .app-nav-twist { display: none; }

/* MOBILE. The bottom bar is five quick slots that must always navigate, so it never shows a
   tree — a 64px horizontal strip has nowhere to put one. Trees live in the More sheet only. */
@media (max-width: 640px) {
  /* Bar form: no twist, no tree. */
  .app-nav-twist { display: none; }
  .app-nav-subgroup { display: none; }

  /* Sheet form: trees and twists come back. Row metrics live in the single block above. */
  .app-shell.is-mobile-more-open .app-nav-twist { display: inline-flex; }
  .app-shell.is-mobile-more-open .app-nav-subgroup { display: flex; }
  .app-shell.is-mobile-more-open .app-nav-subgroup.is-collapsed { display: none; }
}
