/* Desktop sidebar views: full, slim (icon rail) and hidden. The view button lives on the sidebar itself; the toolbar
   button only appears when the sidebar is hidden, to bring it back. Also the bigger Orbit mark that follows the theme. */
@media (min-width: 900px) {
  body.orbit-v27.sidebar-slim { --rail: 72px; }
  body.orbit-v27.sidebar-slim .app-header,
  body.orbit-v27.sidebar-slim .sidebar { width: var(--rail); }
  body.orbit-v27:not(.sidebar-hidden) .shell-toolbar #sidebarToggle { visibility: hidden; pointer-events: none; width: 0; min-width: 0; padding: 0; margin: 0; overflow: hidden; }
  body.orbit-v27 .app-header .sidebar-mode-button { position: absolute; top: 26px; right: 12px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 36px; padding: 7px; border: 0; border-radius: 9px; color: var(--muted, #8a8f98); background: transparent; cursor: pointer; }
  body.orbit-v27 .app-header .sidebar-mode-button:hover, body.orbit-v27 .app-header .sidebar-mode-button[aria-expanded="true"] { color: var(--ink, #fff); background: var(--pale, rgba(255,255,255,.08)); }
  body.orbit-v27 .app-header .sidebar-mode-button svg { width: 20px; height: 20px; }
  body.orbit-v27:not(.sidebar-slim) .app-header .identity { padding-right: 44px; }
  body.orbit-v27.sidebar-slim .app-header .sidebar-mode-button { position: static; order: 0; margin: 8px auto 0; width: 44px; height: 40px; }
  body.orbit-v27.sidebar-slim .sidebar { align-items: center; padding: calc(12px + env(safe-area-inset-top, 0px)) 8px calc(18px + env(safe-area-inset-bottom, 0px)); scrollbar-width: none; }
  body.orbit-v27.sidebar-slim .sidebar::-webkit-scrollbar { display: none; }
  body.orbit-v27.sidebar-slim .app-header .identity { padding: 0; justify-content: center; min-height: 40px; }
  body.orbit-v27.sidebar-slim .identity strong,
  body.orbit-v27.sidebar-slim .tabs button > span:last-child,
  body.orbit-v27.sidebar-slim #sidebarCategories button > span,
  body.orbit-v27.sidebar-slim #sidebarCategories button > small {
    position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important;
    overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
  }
  body.orbit-v27 #sidebarExpand { display: none; }
  body.orbit-v27.sidebar-slim #sidebarExpandUnused { display: flex; align-items: center; justify-content: center; width: 48px; height: 44px; min-height: 44px; margin: 10px 0 0; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--o-muted, #a1a1a6); order: 0; }
  body.orbit-v27.sidebar-slim #sidebarExpand svg { width: 22px; height: 22px; }
  body.orbit-v27.sidebar-slim .tabs { margin: 12px 0 0; align-items: center; gap: 4px; }
  body.orbit-v27.sidebar-slim .tabs button { width: 48px; min-height: 48px; padding: 0; justify-content: center; gap: 0; }
  body.orbit-v27.sidebar-slim .sidebar-section { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--o-line, #2a2a2e); width: 48px; }
  body.orbit-v27.sidebar-slim .sidebar-section-heading { display: none !important; }
  body.orbit-v27.sidebar-slim #sidebarCategories { align-items: center; gap: 4px; }
  body.orbit-v27.sidebar-slim #sidebarCategories button { position: relative; width: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 10px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--o-muted, #a1a1a6); }
  body.orbit-v27.sidebar-slim #sidebarCategories button::before { content: attr(data-mono); }
  body.orbit-v27.sidebar-slim #sidebarCategories button.active { color: #fff; }
  body.orbit-v27.sidebar-slim .sidebar-utility { width: 48px; min-height: 48px; margin-top: 10px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  body.orbit-v27.sidebar-slim .sidebar-utility svg { width: 22px; height: 22px; }

}
@media (max-width: 899px) { body.orbit-v27 .sidebar-mode-button, .sidebar-mode-menu { display: none !important; } }
.sidebar-mode-menu { position: fixed; z-index: 1000; width: 220px; padding: 6px; border-radius: 14px; background: #1c1c1f; border: 1px solid #333338; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.sidebar-mode-menu[hidden] { display: none; }
.sidebar-mode-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: #e8eaed; font: 500 14px/1.2 inherit; text-align: left; cursor: pointer; }
.sidebar-mode-menu button svg { width: 18px; height: 18px; flex: 0 0 18px; color: #a9afb9; }
.sidebar-mode-menu button:hover, .sidebar-mode-menu button:focus-visible { background: rgba(255,255,255,.07); outline: none; }
.sidebar-mode-menu button[aria-checked="true"] { color: #fff; }
.sidebar-mode-menu button[aria-checked="true"] svg { color: #3B9EFF; }
.sidebar-mode-menu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: #3B9EFF; font-weight: 700; }
html[data-theme="light"] .sidebar-mode-menu { background: #fff; border-color: #e3e6eb; box-shadow: 0 16px 40px rgba(15,23,42,.14); }
html[data-theme="light"] .sidebar-mode-menu button { color: #1d2129; }
html[data-theme="light"] .sidebar-mode-menu button:hover, html[data-theme="light"] .sidebar-mode-menu button:focus-visible { background: #f1f3f6; }
html[data-theme="light"] .sidebar-mode-menu button[aria-checked="true"] { color: #0b0d10; }

/* Orbit mark: drawn inline so it takes the theme's ink color (white in dark mode, near-black in light mode). */
body.orbit-v27 .app-header .identity .orbit-mark-inline { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 0; background: transparent !important; overflow: visible; color: #fff; }
body.orbit-v27 .app-header .identity .orbit-mark-inline svg { display: block; width: 100%; height: 100%; overflow: visible; }
html[data-theme="light"] body.orbit-v27 .app-header .identity .orbit-mark-inline { color: #0b0d10; }
body.orbit-v27 .app-header .identity strong { font-size: 21px; }
body.orbit-v27 .app-header .identity { gap: 12px; }
