/* Six comfortable targets; extra sections continue around the same ring. */
@media (max-width:600px) {
  :root { --mobile-nav-safe-bottom:env(safe-area-inset-bottom,0px);--mobile-nav-total:calc(var(--mobile-nav-height,70px) + var(--mobile-nav-safe-bottom)); }
  .sidebar,.mobile-chat-view .sidebar { left:0;right:0;bottom:0;width:100%;height:var(--mobile-nav-total);padding:5px max(9px,env(safe-area-inset-right,0px)) calc(7px + var(--mobile-nav-safe-bottom)) max(9px,env(safe-area-inset-left,0px));border-radius:0; }
  .shell { padding-bottom:calc(var(--mobile-nav-total) + 3px); }
  .mobile-chat-view .shell { padding-bottom:var(--mobile-nav-total); }
  .shell:has(#journal-results) { padding-bottom:var(--mobile-nav-total); }
  .workspace:has(#journal-results) { height:calc(100dvh - var(--mobile-nav-total)); }
  .work-machines.has-work-background .workspace:before,.work-machines.has-work-background .workspace:after { bottom:var(--mobile-nav-total); }
  .topbar .breadcrumb { min-width:0;overflow:hidden; }
  .topbar .breadcrumb strong { min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .topbar .top-meta { flex-shrink:0; }
  .topbar { padding-top:env(safe-area-inset-top,0px);height:calc(60px + env(safe-area-inset-top,0px)); }
  .mobile-chat-view .topbar { height:calc(44px + env(safe-area-inset-top,0px));min-height:calc(44px + env(safe-area-inset-top,0px)); }
  .work-machines.has-work-background .workspace:before,.work-machines.has-work-background .workspace:after { top:calc(60px + env(safe-area-inset-top,0px)); }
  .sidebar > .nav {
    display:flex;flex-direction:row;gap:0;position:relative;
    width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;
    scroll-snap-type:x mandatory;scroll-behavior:auto;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;touch-action:pan-x pinch-zoom;
  }
  .sidebar > .nav::-webkit-scrollbar { display:none; }
  .sidebar > .nav > :is(.nav-btn,.mobile-nav-copy) {
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    flex:0 0 calc(100% / var(--mobile-nav-slots,6));width:auto;min-width:0;
    min-height:44px;height:calc(var(--mobile-nav-height,70px) - 12px);padding:4px 2px;gap:5px;position:relative;
    border:0;border-radius:10px;background:transparent;
    color:var(--ui-text-accent-a8bbb3,#a8bbb3);font-size:calc(9.5px * var(--mobile-nav-scale,1));font-weight:500;
    text-align:center;scroll-snap-align:start;cursor:pointer;
  }
  .sidebar > .nav > :is(.nav-btn,.mobile-nav-copy)[hidden] { display:none; }
  .sidebar > .nav > :is(.nav-btn,.mobile-nav-copy).active {
    background:var(--lime);color:var(--on-selection,var(--ui-text-accent-203b2e,#203b2e));
  }
  .sidebar > .nav > :is(.nav-btn,.mobile-nav-copy) > svg { width:calc(26px * var(--mobile-nav-scale,1));height:calc(26px * var(--mobile-nav-scale,1));flex-shrink:0; }
  .sidebar > .nav > .nav-btn > span:not(.chat-nav-count) { max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
  .sidebar > .nav.mobile-nav-loop > :is(.nav-btn,.mobile-nav-copy) > span:not(.chat-nav-count) { display:none; }
  .sidebar > .nav.mobile-nav-loop > :is(.nav-btn,.mobile-nav-copy)::after {
    content:attr(data-mobile-label);display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:calc(12px * var(--mobile-nav-scale,1));
  }
  .sidebar > .nav > :is(.nav-btn,.mobile-nav-copy) > .chat-nav-count {
    display:inline-flex;position:absolute;top:1px;left:calc(50% + 5px);right:auto;margin:0;
    min-width:17px;height:17px;padding:0 4px;font-size:9px;
    border-radius:20px;background:var(--ui-surface-accent-d6f18c,#d6f18c);color:var(--ui-text-accent-183d2d,#183d2d);
    box-shadow:0 0 0 2px var(--sidebar);align-items:center;justify-content:center;
  }
  .sidebar > .nav > :is(.nav-btn,.mobile-nav-copy):focus-visible { outline:2px solid var(--lime);outline-offset:-3px; }
}
