/* One visible primary navigation per breakpoint; five direct links on phones. */
.komi-bottom-nav, body #komiMasthead #komiQuickAccess .komi-mobile-shop-link { display: none !important; }
body #komiMasthead #komiHeaderAniCoin:not([hidden]) {
  flex: 0 1 auto; width: auto; min-width: 43px; max-width: 105px;
  white-space: nowrap; overflow: hidden;
  font: 700 .79rem/1.15 ui-monospace,SFMono-Regular,Consolas,monospace;
  font-variant-numeric: tabular-nums;
}
body #komiHeaderAniCoin svg { width: 15px; height: 15px; flex: 0 0 15px; }
body #komiHeaderAniCoinValue { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1150px) {
  body #komiMasthead:has(#komiHeaderAniCoin:not([hidden])) :is(.komi-top-search-label,#komiSearchTrigger kbd,#komiJourneyAccount > span) {
    display: none !important;
  }
}
@media (max-width: 767px) {
  :root { scroll-padding-bottom: calc(var(--obs-mobile-bar,59px) + 12px); }
  body #mainAppLayoutContainer > #komiMasthead .komi-journey-nav,
  body > .komi-standalone-header .komi-journey-nav { display: none !important; }
  body :is(#komiMasthead,.komi-standalone-header) > .komi-bottom-nav {
    display: grid !important; position: fixed;
    z-index: 2; inset: auto 0 0; box-sizing: border-box;
    grid-template-columns: repeat(5,minmax(0,1fr));
    height: var(--obs-mobile-bar,calc(59px + env(safe-area-inset-bottom,0px)));
    margin: 0;
    padding: 2px max(4px,env(safe-area-inset-right,0px))
      calc(3px + env(safe-area-inset-bottom,0px)) max(4px,env(safe-area-inset-left,0px));
    background: rgb(5 5 5 / .90);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    border-top: 1px solid rgb(255 255 255 / .10);
  }
  body :is(#komiMasthead,.komi-standalone-header) > .komi-bottom-nav > :is(a,button) {
    display: flex; position: relative; flex-direction: column;
    justify-content: center; align-items: center; gap: 4px;
    min-width: 0; min-height: 44px; padding: 3px 0 0;
    color: #bcbcbc !important; background: transparent !important;
    border: 0; border-radius: 6px; text-decoration: none; white-space: nowrap;
    font: 650 clamp(9px,2.45vw,11px)/1.15 system-ui,sans-serif;
  }
  body :is(#komiMasthead,.komi-standalone-header) .komi-bottom-nav svg { width: 20px; height: 20px; flex: 0 0 20px; }
  body :is(#komiMasthead,.komi-standalone-header) .komi-bottom-nav > :is([aria-current],[aria-pressed="true"]) {
    color: #fafafa !important;
  }
  .komi-bottom-nav > :is([aria-current],[aria-pressed="true"])::before {
    content: ""; position: absolute; inset: 0 50% auto auto; transform: translateX(50%);
    width: 24px; height: 2px; border-radius: 2px; background: #fafafa;
  }
  body :is(#komiMasthead,.komi-standalone-header) .komi-bottom-nav > :focus-visible {
    outline: 2px solid #fafafa !important; outline-offset: -2px;
  }
  body:has(> .komi-standalone-header), body #mainAppLayoutContainer:has(> #komiMasthead) {
    padding-bottom: calc(var(--obs-mobile-bar,59px) + 12px) !important;
  }
  body:has(:is(#watchModal,#watchPartyModal,#authModal).active) #komiMasthead .komi-bottom-nav {
    visibility: hidden; pointer-events: none;
  }
  /* Use the dialog's own open state so every dismissal path restores the bar. */
  @media (prefers-reduced-motion: no-preference) {
    body #komiMasthead .komi-bottom-nav { transition: opacity 160ms ease-out; }
  }
  body:has(> #komiSearchPanel[open]) #komiMasthead .komi-bottom-nav {
    visibility: hidden; opacity: 0; pointer-events: none; transition: none;
  }
  body #komiMasthead #komiQuickAccess .komi-mobile-shop-link { display: flex !important; }
  body #komiMasthead .komi-top-account { min-width: 0; }
  body #komiMasthead #komiHeaderAniCoin:not([hidden]) { max-width: 70px; padding: 0 6px; }
  body #komiMasthead #komiJourneyAccount > span { display: none !important; }
}
@media (max-width: 410px) {
  body #komiMasthead:has(#komiHeaderAniCoin:not([hidden])) .komi-journey-brand > span { display: none !important; }
}
