/* Compact controls at the end of the main page's More drawer. */
#nav .nav-preferences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 290px);
  gap: 7px;
  margin: 5px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #f2cfae;
}

#nav .nav-preferences > p { display: none; }

#nav .nav-preference,
#nav .nav-theme-preference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 5px 8px;
  border: 1px solid #f2cfae;
  border-radius: 12px;
  background: #fffdf9;
  color: #241109;
  font: 800 .7rem/1 system-ui, "Noto Sans Armenian", sans-serif;
}

#nav .nav-preference .lang {
  display: block !important;
  width: 51px !important;
  min-height: 29px !important;
  height: 29px !important;
  padding: 0 2px !important;
  border: 1px solid #f2cfae !important;
  border-radius: 9px !important;
  background: #fff0dd !important;
  color: #8d3008 !important;
  text-align: center !important;
  font: 900 .67rem/1 system-ui, sans-serif !important;
  appearance: auto;
}

#nav .nav-theme-preference {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

#nav .nav-theme-preference:hover {
  border-color: #eb6515;
  background: #fff0dd;
}

#nav .nav-preference-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: #fff0dd;
  color: #8d3008;
  font-size: 1rem;
}

#nav .nav-theme-preference > span:last-child {
  display: grid;
  gap: 3px;
}

#nav .nav-theme-preference b { font-size: .7rem; }

#nav .nav-theme-preference small {
  color: #8d3008;
  font-size: .57rem;
  font-weight: 800;
}

body.night #nav .nav-preferences { border-color: #713414; }

body.night #nav .nav-preference,
body.night #nav .nav-theme-preference {
  border-color: #713414;
  background: #241109 !important;
  color: #fff4e8 !important;
}

body.night #nav .nav-preference .lang {
  border-color: #713414 !important;
  background: #351b0f !important;
  color: #ffc28c !important;
}

body.night #nav .nav-theme-preference:hover {
  border-color: #f87520;
  background: #351b0f !important;
}

body.night #nav .nav-preference-icon {
  background: #351b0f;
  color: #ffc28c;
}

body.night #nav .nav-theme-preference small { color: #ffd1ae; }

header #nav.open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  left: auto;
  right: 0;
  width: min(420px, calc(100vw - 40px));
  min-width: min(420px, calc(100vw - 40px));
  column-gap: 8px;
  row-gap: 6px;
}

header #nav.open > a:not(.nav-account-card) {
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 6px 8px;
  border: 1px solid #f2cfae;
  border-radius: 10px;
  background: #fff8ef;
  font-size: .71rem;
  line-height: 1.12;
}

#nav .nav-account-card,
#nav .nav-preferences { grid-column: 1 / -1; }

body.night header #nav.open > a:not(.nav-account-card) {
  border-color: #713414;
  background: #2d160c;
  color: #fff4e8;
}

@media (max-width: 610px) {
  header #nav.open {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    max-height: calc(100dvh - 88px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  #nav .nav-preferences {
    width: 100%;
    margin-top: 4px;
    padding-top: 8px;
  }

  #nav .nav-preference,
  #nav .nav-theme-preference { min-height: 40px; }

}
