/* Final shared contract for the bottom navigation on every SSR page. */
body.go-ssr {
  --bottom-nav-height: 61px;
  --bottom-nav-control-size: 40px;
}

body.go-ssr .sidebar-footer {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 40;
  box-sizing: border-box;
  display: block;
  flex: 0 0 var(--bottom-nav-height);
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--bottom-nav-height);
  min-height: var(--bottom-nav-height);
  max-height: var(--bottom-nav-height);
  margin-top: auto;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--map-overlay-bg);
  box-shadow: none;
  backdrop-filter: none;
}

body.go-ssr .sidebar-footer-row {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--bottom-nav-control-size);
  min-height: var(--bottom-nav-control-size);
  margin: 0;
  gap: 8px;
  flex-wrap: nowrap;
}

body.go-ssr .sidebar-footer .theme-switcher {
  display: flex;
  flex: 0 0 auto;
  margin: 0;
  gap: 6px;
  flex-wrap: nowrap;
}

body.go-ssr .sidebar-footer .sidebar-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  gap: 6px;
  flex-wrap: nowrap;
}

body.go-ssr .sidebar-footer .theme-button,
body.go-ssr .sidebar-footer .quick-link {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: var(--bottom-nav-control-size);
  min-width: var(--bottom-nav-control-size);
  max-width: var(--bottom-nav-control-size);
  height: var(--bottom-nav-control-size);
  min-height: var(--bottom-nav-control-size);
  max-height: var(--bottom-nav-control-size);
  margin: 0;
  padding: 0;
  line-height: 1;
  transform: none;
}

body.go-ssr .sidebar-footer .quick-link-icon,
body.go-ssr .sidebar-footer .theme-icon {
  width: 18px;
  height: 18px;
}

body.go-ssr .sidebar-footer .quick-link.is-current,
body.go-ssr .sidebar-footer .theme-button.is-active {
  border-color: rgba(84, 199, 176, 0.58);
  background: rgba(84, 199, 176, 0.16);
  color: var(--text);
  transform: none;
}

html[data-theme="light"] body.go-ssr .sidebar-footer {
  background: var(--map-overlay-bg);
}

@media (min-width: 1121px) {
  body[data-page="map"].go-ssr .sidebar:not(.is-list-collapsed) {
    bottom: 0;
    height: auto;
  }

  body[data-page="map"].go-ssr .sidebar.is-list-collapsed .sidebar-footer {
    position: fixed;
    left: 10px;
    right: auto;
    bottom: 0;
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    max-width: var(--sidebar-w);
    border: 1px solid var(--map-overlay-border);
    border-radius: 22px;
    box-shadow: var(--map-overlay-shadow-lg);
  }
}

@media (max-width: 920px) {
  body.go-ssr {
    --bottom-nav-height: calc(57px + env(safe-area-inset-bottom, 0px));
  }

  body.go-ssr .sidebar-footer,
  body[data-page="map"].go-ssr .app-sidebar > .sidebar-footer,
  body[data-page="service"].go-ssr .sidebar-footer,
  body[data-page="reports"].go-ssr .sidebar-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1800;
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    height: var(--bottom-nav-height);
    min-height: var(--bottom-nav-height);
    max-height: var(--bottom-nav-height);
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--map-overlay-bg);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px);
  }

  body.go-ssr .sidebar-footer-row {
    width: 100%;
    max-width: min(100%, 520px);
    margin: 0 auto;
  }

  body.go-ssr .sidebar-footer .sidebar-nav {
    flex: 1 1 auto;
    justify-content: space-between;
  }
}
