:root {
  --tida-dock-space: calc(62px + env(safe-area-inset-bottom, 0px));
}

#tida-bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  box-sizing: border-box;
  width: min(100%, 480px);
  height: var(--tida-dock-space);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid #987851;
  background: var(--tida-panel-raised, #14263a);
  box-shadow: 0 -4px 14px #09132185;
  overflow: hidden;
}

#tida-bottom-nav > a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 4px;
  padding: 4px 2px;
  border-right: 1px solid #769eac24;
  font: 11px/1.2 "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  text-align: center;
}
#tida-bottom-nav > a:last-child { border-right: 0; }
#tida-bottom-nav > a > span { max-width: 100%; overflow-wrap: anywhere; }
#tida-bottom-nav > a > .tida-illustrated-icon { width: 27px; height: 27px; flex: none; border-radius: 4px; }

html.tida-modern-palette body #tida-bottom-nav > a { color: #b6c6d4 !important; }
html.tida-modern-palette body #tida-bottom-nav > a[aria-current="page"] {
  background: #234862;
  color: var(--tida-gold, #e3bc76) !important;
}
#tida-bottom-nav > a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e3bc7699, transparent);
}
#tida-bottom-nav > a:focus-visible {
  outline: 2px solid #e3bc76;
  outline-offset: -3px;
}
#tida-bottom-nav .tida-dock-indicator {
  position: absolute;
  top: 8px;
  left: calc(50% + 10px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e3bc76;
  box-shadow: 0 0 0 2px #14263a;
}
#containerAPI > .bdr.bg_main.tida-has-dock {
  padding-bottom: calc(var(--tida-dock-space) + 12px);
}
body:has(#tida-bottom-nav) .tida-toast {
  bottom: calc(var(--tida-dock-space) + 12px);
}

@media (min-width: 481px) {
  #tida-bottom-nav { border-radius: 0 0 12px 12px; }
}
@media (max-width: 439px) {
  :root { --tida-dock-space: calc(104px + env(safe-area-inset-bottom, 0px)); }
  #tida-bottom-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #tida-bottom-nav > a:nth-child(-n+4) { border-bottom: 1px solid #769eac24; }
  #tida-bottom-nav > a:nth-child(4) { border-right: 0; }
}
@media (max-width: 360px) {
  #tida-bottom-nav > a { font-size: 10px; padding-inline: 1px; }
}
@media (hover: hover) and (pointer: fine) {
  #tida-bottom-nav > a:not([aria-current]):hover { background: #34648233; }
}
