.wordwrap {
  white-space: pre-wrap;
  word-wrap: break-word;
}

:root[data-theme="light"] {
  color-scheme: light;
}

.footer {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  width: min(calc(100% - 28px), 860px);
  transform: translateX(-50%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 100px;
  min-height: 56px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(24, 28, 25, .86);
  box-shadow: 0 14px 42px rgba(0, 0, 0, .28);
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .navbar {
  border-color: rgba(79, 154, 88, .18);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 14px 42px rgba(71, 87, 72, .14);
}

.menu-toggle,
.navbar-links a {
  display: block;
  min-height: 38px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  color: #f3f6f0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

:root[data-theme="light"] .menu-toggle,
:root[data-theme="light"] .navbar-links a {
  color: #1f2921;
}

.navbar-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

.menu-toggle:hover,
.navbar-links a:hover,
.navbar-links a.active {
  background: rgba(120, 216, 122, .14);
  color: #9af39b;
  text-decoration: none;
}

:root[data-theme="light"] .menu-toggle:hover,
:root[data-theme="light"] .navbar-links a:hover,
:root[data-theme="light"] .navbar-links a.active {
  background: rgba(79, 154, 88, .12);
  color: #4f9a58;
}

.menu-toggle:active,
.navbar-links a:active {
  transform: translateY(1px);
}

#overlay {
  visibility: hidden;
  position: absolute;
  inset: 0;
  z-index: 1000;
  text-align: center;
  font-family: sans-serif;
  font-size: medium;
}

#overlay div {
  width: 250px;
  margin: 100px auto;
  border: 1px solid grey;
  padding: 15px;
  background-color: #fff;
  text-align: center;
}

@media screen and (max-width: 720px) {
  .footer {
    bottom: 10px;
    width: calc(100% - 20px);
  }

  .navbar {
    padding: 10px;
    min-height: 60px;
    justify-content: stretch;
  }

  .menu-toggle,
  .navbar-links a {
    min-height: 40px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.25;
  }

  .navbar:not(.is-collapsed) .navbar-links {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .navbar:not(.is-collapsed) .navbar-links a {
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
    overflow: visible;
    text-overflow: clip;
  }

  .navbar.is-collapsed {
    display: block;
  }

  .navbar.is-collapsed .menu-toggle {
    display: inline-flex;
    width: 100%;
    white-space: normal;
  }

  .navbar.is-collapsed .navbar-links {
    display: none;
    margin-top: 8px;
    flex-direction: column;
    align-items: stretch;
    max-height: min(50vh, 320px);
    overflow-y: auto;
  }

  .navbar.is-collapsed.is-open .navbar-links {
    display: flex;
  }

  .navbar.is-collapsed .navbar-links a {
    width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
  }
}

@media screen and (max-width: 380px) {
  .footer {
    width: calc(100% - 16px);
  }

  .navbar {
    padding: 8px;
    border-radius: 16px;
  }

  .menu-toggle,
  .navbar-links a {
    min-height: 38px;
    padding: 8px 6px;
    font-size: 11px;
    line-height: 1.15;
  }

  .menu-toggle-icon {
    font-size: 14px;
  }

  .navbar:not(.is-collapsed) .navbar-links a {
    padding-left: 6px;
    padding-right: 6px;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .navbar.is-collapsed .menu-toggle {
    font-size: 12px;
  }
}

@media print {
  .footer {
    display: none;
  }
}
