/* Bottom nav bar. Colours come from Ionic's theme variables so light/dark
   mode follow the app; fallbacks are upstream's light-theme values. */

:root {
  --rso-bar-height: 60px;
  --rso-bar-total: calc(var(--rso-bar-height) + env(safe-area-inset-bottom, 0px));
}

/* Shorten the Ionic app shell so page content ends above the bar. */
html.rso-bar-on ion-app {
  bottom: var(--rso-bar-total) !important;
}

#rso-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  height: var(--rso-bar-total);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  background: var(--ion-toolbar-background, var(--ion-background-color, #f8f8f8));
  border-top: 1px solid var(--ion-border-color, rgba(0, 0, 0, 0.12));
  font-family: var(--ion-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

#rso-bottom-bar[hidden] {
  display: none;
}

#rso-bottom-bar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  color: var(--ion-color-medium, #92949c);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

#rso-bottom-bar a.rso-active {
  color: var(--ion-color-primary, #00a8ff);
}

#rso-bottom-bar .rso-icon {
  position: relative;
  width: 26px;
  height: 26px;
}

#rso-bottom-bar svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#rso-bottom-bar .rso-label {
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rso-bottom-bar .rso-badge {
  position: absolute;
  top: -7px;
  left: 16px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 10px;
  background: var(--ion-color-danger, #eb445a);
  color: var(--ion-color-danger-contrast, #fff);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}

#rso-bottom-bar .rso-badge[hidden] {
  display: none;
}

@media print {
  #rso-bottom-bar {
    display: none;
  }
  html.rso-bar-on ion-app {
    bottom: 0 !important;
  }
}
